]>
Commit | Line | Data |
---|---|---|
83c7162d | 1 | // run-rustfix |
9e0c209e | 2 | |
83c7162d | 3 | // Point at the captured immutable outer variable |
9e0c209e | 4 | |
83c7162d XL |
5 | fn foo(mut f: Box<FnMut()>) { |
6 | f(); | |
9e0c209e | 7 | } |
1a4d82fc | 8 | |
7453a54e | 9 | fn main() { |
83c7162d | 10 | let mut y = true; |
48663c56 XL |
11 | foo(Box::new(move || y = false) as Box<_>); |
12 | //~^ ERROR cannot assign to `y`, as it is not declared as mutable | |
223e47cc | 13 | } |