]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/fn-closure-mutable-capture.nll.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / fn / fn-closure-mutable-capture.nll.stderr
1 error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
2   --> $DIR/fn-closure-mutable-capture.rs:15:17
3    |
4 LL |     bar(move || x = 1);
5    |                 ^^^^^ cannot assign
6    |
7 help: consider changing this to accept closures that implement `FnMut`
8   --> $DIR/fn-closure-mutable-capture.rs:15:9
9    |
10 LL |     bar(move || x = 1);
11    |         ^^^^^^^^^^^^^
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0594`.