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 09:56:47 -06: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-22 18:42:32 -06:00
LL | bar(move || x = 1);
2022-06-27 00:33:19 -05:00
| --- ------- ^^^^^ cannot assign
| | |
| | in this closure
| expects `Fn` instead of `FnMut`
error: aborting due to previous error
2019-11-06 06:58:44 -06:00
For more information about this error, try `rustc --explain E0594`.