]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrow-immutable-upvar-mutation-impl-trait.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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    |     ------- in this closure
9 LL |         x += 1;
10    |         ^^^^^^ cannot assign
11
12 error: aborting due to previous error
13
14 For more information about this error, try `rustc --explain E0594`.