]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/fn-closure-mutable-capture.stderr
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / fn / fn-closure-mutable-capture.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:5:17
3    |
4 LL | pub fn bar<F: Fn()>(_f: F) {}
5    |                         - change this to accept `FnMut` instead of `Fn`
6 ...
7 LL |     bar(move || x = 1);
8    |     --- ------- ^^^^^ cannot assign
9    |     |   |
10    |     |   in this closure
11    |     expects `Fn` instead of `FnMut`
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0594`.