2022-11-13 19:53:35 +00:00
|
|
|
error[E0382]: borrow of moved value: `b`
|
|
|
|
--> $DIR/closure.rs:27:5
|
2020-05-27 05:05:09 +00:00
|
|
|
|
|
2022-11-13 19:53:35 +00:00
|
|
|
LL | let mut c = b;
|
|
|
|
| - value moved here
|
|
|
|
...
|
2020-05-27 05:05:09 +00:00
|
|
|
LL | b();
|
2022-11-13 19:53:35 +00:00
|
|
|
| ^ value borrowed here after move
|
2022-07-30 05:37:48 +00:00
|
|
|
|
|
2022-11-13 19:53:35 +00:00
|
|
|
note: closure cannot be moved more than once as it is not `Copy` due to moving the variable `a` out of its environment
|
|
|
|
--> $DIR/closure.rs:20:9
|
2020-05-27 05:05:09 +00:00
|
|
|
|
|
2022-11-13 19:53:35 +00:00
|
|
|
LL | a = 1;
|
|
|
|
| ^
|
|
|
|
help: consider mutably borrowing `b`
|
2022-03-29 02:30:39 +00:00
|
|
|
|
|
2022-11-13 19:53:35 +00:00
|
|
|
LL | let mut c = &mut b;
|
|
|
|
| ++++
|
2020-05-27 05:05:09 +00:00
|
|
|
|
2022-11-13 19:53:35 +00:00
|
|
|
error: aborting due to previous error
|
2020-05-27 05:05:09 +00:00
|
|
|
|
2022-11-13 19:53:35 +00:00
|
|
|
For more information about this error, try `rustc --explain E0382`.
|