rust/tests/ui/lint/unused/unused-mut-warning-captured-var.fixed
2024-02-16 20:02:50 +00:00

10 lines
162 B
Rust

//@ run-rustfix
#![forbid(unused_mut)]
fn main() {
let x = 1;
//~^ ERROR: variable does not need to be mutable
(move|| { println!("{}", x); })();
}