rust/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.stderr

20 lines
586 B
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure
--> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:11:9
2018-08-08 07:28:26 -05:00
|
LL | counter += 1;
| ^^^^^^^^^^^^ cannot assign
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:10:10
2018-08-08 07:28:26 -05:00
|
LL | call(|| {
| __________^
LL | | counter += 1;
LL | |
2018-08-08 07:28:26 -05:00
LL | | });
| |_____^
error: aborting due to previous error
2019-11-06 06:58:44 -06:00
For more information about this error, try `rustc --explain E0594`.