about summary refs log tree commit diff
path: root/src/test/rustfix/closure-immutable-outer-variable.fixed
blob: 05bbc13d714fac81c2f05c131a0a0dd1d7b0cb75 (plain)
1
2
3
4
5
6
7
8
9
10
// 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<_>);
}