]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.stderr
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / unboxed-closures / unboxed-closures-mutated-upvar-from-fn-closure.stderr
1 error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure
2   --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:11:9
3    |
4 LL | fn call<F>(f: F) where F : Fn() {
5    |               - change this to accept `FnMut` instead of `Fn`
6 ...
7 LL |     call(|| {
8    |     ---- -- in this closure
9    |     |
10    |     expects `Fn` instead of `FnMut`
11 LL |         counter += 1;
12    |         ^^^^^^^^^^^^ cannot assign
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0594`.