2019-04-22 07:40:08 +00:00
|
|
|
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
|
2018-01-15 21:27:58 +00:00
|
|
|
|
|
2020-02-04 00:08:45 +00:00
|
|
|
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
|
2020-02-04 00:08:45 +00:00
|
|
|
| expects `Fn` instead of `FnMut`
|
2018-01-15 21:27:58 +00:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2019-11-06 12:58:44 +00:00
|
|
|
For more information about this error, try `rustc --explain E0594`.
|