mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
29 lines
506 B
Rust
29 lines
506 B
Rust
#![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`
|
|
}
|