2018-08-08 07:28:26 -05:00
|
|
|
error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:11:9
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | fn call<F>(f: F) where F : Fn() {
|
|
|
|
| - change this to accept `FnMut` instead of `Fn`
|
2020-02-03 18:08:45 -06:00
|
|
|
...
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | call(|| {
|
|
|
|
| ---- expects `Fn` instead of `FnMut`
|
|
|
|
LL | counter += 1;
|
|
|
|
| ^^^^^^^^^^^^ cannot assign
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2019-11-06 06:58:44 -06:00
|
|
|
For more information about this error, try `rustc --explain E0594`.
|