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