rust/tests/ui/fn/fn-closure-mutable-capture.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
513 B
Plaintext
Raw Normal View History

error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
2018-12-25 15:56:47 +00:00
--> $DIR/fn-closure-mutable-capture.rs:5:17
|
LL | pub fn bar<F: Fn()>(_f: F) {}
| - change this to accept `FnMut` instead of `Fn`
...
2018-02-23 00:42:32 +00:00
LL | bar(move || x = 1);
2022-06-27 05:33:19 +00:00
| --- ------- ^^^^^ cannot assign
| | |
| | in this closure
| expects `Fn` instead of `FnMut`
error: aborting due to previous error
2019-11-06 12:58:44 +00:00
For more information about this error, try `rustc --explain E0594`.