Closed
Description
fn main() {
let x = [1i];
for mut loop_unused in x.iter() {}
let mut normal_unused = 1i;
}
Compiling gives
<anon>:5:9: 5:26 warning: unused variable: `normal_unused`, #[warn(unused_variable)] on by default
<anon>:5 let mut normal_unused = 1i;
^~~~~~~~~~~~~~~~~
<anon>:5:9: 5:26 warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
<anon>:5 let mut normal_unused = 1i;
^~~~~~~~~~~~~~~~~
but loop_unused
should get those sort of warnings too.
(This is possibly related to #16205 in that it's probably caused by a mishandling of the for
pattern.)