]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrow-immutable-upvar-mutation-impl-trait.stderr
Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup
[rust.git] / src / test / ui / borrowck / borrow-immutable-upvar-mutation-impl-trait.stderr
1 error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
2   --> $DIR/borrow-immutable-upvar-mutation-impl-trait.rs:11:9
3    |
4 LL |   fn bar() -> impl Fn() -> usize {
5    |      ---      ------------------ change this to return `FnMut` instead of `Fn`
6 LL |       let mut x = 0;
7 LL | /     move || {
8 LL | |         x += 1;
9    | |         ^^^^^^ cannot assign
10 LL | |         x
11 LL | |     }
12    | |_____- in this closure
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0594`.