rust/src/test/rustfix/closure-immutable-outer-variable.fixed
2018-12-28 21:50:33 +01:00

10 lines
177 B
Rust

// Point at the captured immutable outer variable
fn foo(mut f: Box<FnMut()>) {
f();
}
fn main() {
let mut y = true;
foo(Box::new(move || y = false) as Box<_>);
}