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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
549 B
Plaintext
Raw Normal View History

2018-08-08 14:28:26 +02: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 14:28:26 +02:00
|
2022-06-27 07:45:35 +02:00
LL | fn call<F>(f: F) where F : Fn() {
| - change this to accept `FnMut` instead of `Fn`
...
2022-06-27 07:45:35 +02:00
LL | call(|| {
2022-06-27 07:33:19 +02:00
| ---- -- in this closure
| |
| expects `Fn` instead of `FnMut`
2022-06-27 07:45:35 +02:00
LL | counter += 1;
| ^^^^^^^^^^^^ cannot assign
2018-08-08 14:28:26 +02:00
error: aborting due to previous error
2019-11-06 13:58:44 +01:00
For more information about this error, try `rustc --explain E0594`.