2018-08-08 07:28:26 -05:00
|
|
|
error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:14:9
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | counter += 1;
|
|
|
|
| ^^^^^^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
|
help: consider changing this to accept closures that implement `FnMut`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:13:10
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | call(|| {
|
|
|
|
| __________^
|
|
|
|
LL | | counter += 1;
|
2019-03-17 04:52:07 -05:00
|
|
|
LL | |
|
|
|
|
LL | |
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | | });
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|