2021-08-01 19:18:50 -05:00
|
|
|
#![deny(unused_variables)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// type annotation, attributes
|
|
|
|
#[allow(unused_variables)]
|
|
|
|
let Some(_): Option<u32> = Some(Default::default()) else {
|
|
|
|
let x = 1; // OK
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
|
2022-02-20 21:38:39 -06:00
|
|
|
let Some(_): Option<u32> = Some(Default::default()) else {
|
|
|
|
let x = 1; //~ ERROR unused variable: `x`
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
|
2021-08-01 19:18:50 -05:00
|
|
|
let x = 1; //~ ERROR unused variable: `x`
|
|
|
|
}
|