]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-46023.rs
Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
[rust.git] / src / test / ui / issues / issue-46023.rs
1 // revisions: ast mir
2 //[mir]compile-flags: -Z borrowck=mir
3
4 fn main() {
5     let x = 0;
6
7     (move || {
8         x = 1;
9         //[mir]~^ ERROR cannot assign to `x`, as it is not declared as mutable [E0594]
10         //[ast]~^^ ERROR cannot assign to captured outer variable in an `FnMut` closure [E0594]
11     })()
12 }