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