rust/src/test/ui/unused/unused-mut-warning-captured-var.fixed

10 lines
157 B
Rust
Raw Normal View History

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