rust/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr
2019-04-18 13:29:28 -04:00

20 lines
525 B
Plaintext

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:14:9
|
LL | counter += 1;
| ^^^^^^^^^^^^ cannot assign
|
help: consider changing this to accept closures that implement `FnMut`
--> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:13:10
|
LL | call(|| {
| __________^
LL | | counter += 1;
LL | |
LL | |
LL | | });
| |_____^
error: aborting due to previous error