-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
Description
fn main() {
for _ in range(1i, 101) {
let x = ();
match () {
a => {}
}
}
}
compiles without a peep, even though x
and a
are unused. Commenting out the for
gives the expected output:
<anon>:3:13: 3:14 warning: unused variable: `x`, #[warn(unused_variable)] on by default
<anon>:3 let x = ();
^
<anon>:5:13: 5:14 warning: unused variable: `a`, #[warn(unused_variable)] on by default
<anon>:5 a => {}
^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.