Closed
Description
Code:
fn main() {
let mut i = 0;
[].iter().for_each(|_: &i32| {
[].iter().for_each(move |_: &i32| {
i += 1;
});
});
}
Output:
warning: variable does not need to be mutable
--> src/main.rs:3:9
|
3 | let mut i = 0;
| ----^
| |
| help: remove this `mut`
|
= note: #[warn(unused_mut)] on by default
Finished dev [unoptimized + debuginfo] target(s) in 1.26s
Running `target/debug/playground`
Removing mut
breaks the code.