Skip to content

Rollup of 7 pull requests #94251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d98a052
Update libc to 0.2.118
glaubitz Feb 16, 2022
49a5456
tidy: fire less "ignoring file length unneccessarily" warnings
est31 Feb 20, 2022
f810314
solarish current_exe using libc call directly
devnexen Feb 20, 2022
c97f05c
compiletest: Print process output info with less whitespace
aDotInTheVoid Feb 20, 2022
e7730dc
Expand let-else allow tests
est31 Feb 21, 2022
5bd7106
Add regression test for #92069
est31 Feb 21, 2022
2e8a766
Simplify gating of BPF w registers behind the alu32 target feature
Amanieu Feb 17, 2022
1ceb104
On ARM, use relocation_model to detect whether r9 should be reserved
Amanieu Feb 17, 2022
fc41d4b
Take CodegenFnAttrs into account when validating asm! register operands
Amanieu Feb 17, 2022
fb5539b
Add tests
Amanieu Feb 19, 2022
a60b791
Add ignore-tidy-filelength
Amanieu Feb 21, 2022
fb1ee87
ScalarMaybeUninit is explicitly hexadecimal in its formatting
RalfJung Feb 22, 2022
e9ff853
Rollup merge of #94052 - glaubitz:libc-update, r=Mark-Simulacrum
matthiaskrgr Feb 22, 2022
fa60d8d
Rollup merge of #94169 - Amanieu:asm_stuff, r=nagisa
matthiaskrgr Feb 22, 2022
caeb466
Rollup merge of #94178 - est31:tolerant_lines_check, r=Mark-Simulacrum
matthiaskrgr Feb 22, 2022
ab03d4a
Rollup merge of #94179 - devnexen:getexecname_directcall, r=kennytm
matthiaskrgr Feb 22, 2022
4af756d
Rollup merge of #94196 - aDotInTheVoid:terse-procres-info, r=Mark-Sim…
matthiaskrgr Feb 22, 2022
b48ddd2
Rollup merge of #94208 - est31:let_else, r=Mark-Simulacrum
matthiaskrgr Feb 22, 2022
72e913f
Rollup merge of #94246 - RalfJung:hex, r=oli-obk
matthiaskrgr Feb 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expand let-else allow tests
The #[allow(...)] directive was tested for the body and the pattern,
but non-presence of it wasn't tested. Furthermore, it wasn't tested
for the expression. We add expression tests as well as ones checking
the non-presence of the directive.
  • Loading branch information
est31 committed Feb 21, 2022
commit e7730dcb7eb29a10ee73f269f4dc6e9d606db0da
30 changes: 30 additions & 0 deletions src/test/ui/let-else/let-else-allow-in-expr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#![feature(let_else)]

#![deny(unused_variables)]

fn main() {
let Some(_): Option<u32> = ({
let x = 1; //~ ERROR unused variable: `x`
Some(1)
}) else {
return;
};

#[allow(unused_variables)]
let Some(_): Option<u32> = ({
let x = 1;
Some(1)
}) else {
return;
};

let Some(_): Option<u32> = ({
#[allow(unused_variables)]
let x = 1;
Some(1)
}) else {
return;
};

let x = 1; //~ ERROR unused variable: `x`
}
20 changes: 20 additions & 0 deletions src/test/ui/let-else/let-else-allow-in-expr.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
error: unused variable: `x`
--> $DIR/let-else-allow-in-expr.rs:7:13
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
note: the lint level is defined here
--> $DIR/let-else-allow-in-expr.rs:3:9
|
LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^

error: unused variable: `x`
--> $DIR/let-else-allow-in-expr.rs:29:9
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`

error: aborting due to 2 previous errors

5 changes: 3 additions & 2 deletions src/test/ui/let-else/let-else-allow-unused.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// check-pass
// issue #89807

#![feature(let_else)]
Expand All @@ -10,5 +9,7 @@ fn main() {
#[allow(unused)]
let banana = 1;
#[allow(unused)]
let Some(chaenomeles) = value else { return }; // OK
let Some(chaenomeles) = value.clone() else { return }; // OK

let Some(chaenomeles) = value else { return }; //~ ERROR unused variable: `chaenomeles`
}
14 changes: 14 additions & 0 deletions src/test/ui/let-else/let-else-allow-unused.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: unused variable: `chaenomeles`
--> $DIR/let-else-allow-unused.rs:14:14
|
LL | let Some(chaenomeles) = value else { return };
| ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_chaenomeles`
|
note: the lint level is defined here
--> $DIR/let-else-allow-unused.rs:5:8
|
LL | #[deny(unused_variables)]
| ^^^^^^^^^^^^^^^^

error: aborting due to previous error

5 changes: 5 additions & 0 deletions src/test/ui/let-else/let-else-check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ fn main() {
return;
};

let Some(_): Option<u32> = Some(Default::default()) else {
let x = 1; //~ ERROR unused variable: `x`
return;
};

let x = 1; //~ ERROR unused variable: `x`
}
10 changes: 8 additions & 2 deletions src/test/ui/let-else/let-else-check.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unused variable: `x`
--> $DIR/let-else-check.rs:13:9
--> $DIR/let-else-check.rs:18:9
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
Expand All @@ -10,5 +10,11 @@ note: the lint level is defined here
LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^

error: aborting due to previous error
error: unused variable: `x`
--> $DIR/let-else-check.rs:14:13
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`

error: aborting due to 2 previous errors