rust/src/test/rustfix/closure-immutable-outer-variable.rs
2018-12-25 21:08:33 -07:00

10 lines
173 B
Rust

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