]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / unboxed-closures / unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr
1 error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure
2   --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:14:9
3    |
4 LL |         counter += 1;
5    |         ^^^^^^^^^^^^ cannot assign
6    |
7 help: consider changing this to accept closures that implement `FnMut`
8   --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:13:10
9    |
10 LL |       call(|| {
11    |  __________^
12 LL | |         counter += 1;
13 LL | |         //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure
14 LL | |         //[mir]~^^ ERROR cannot assign to `counter`
15 LL | |     });
16    | |_____^
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0594`.