blob: a9ecbbeea4751961420d091bf5828f4da6cf2099 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
// revisions: ast mir
//[mir]compile-flags: -Z borrowck=mir
fn main() {
let x = 0;
(move || {
x = 1;
//[mir]~^ ERROR cannot assign to `x`, as it is not declared as mutable [E0594]
//[ast]~^^ ERROR cannot assign to captured outer variable in an `FnMut` closure [E0594]
})()
}
|