2022-10-24 16:19:48 -05:00
|
|
|
error[E0382]: use of moved value
|
2022-10-26 06:41:57 -05:00
|
|
|
--> $DIR/track2.rs:LL:CC
|
2022-10-24 16:19:48 -05:00
|
|
|
|
|
|
|
|
LL | let _moved @ _from = String::from("foo");
|
|
|
|
| ^^^^^^ ----- ------------------- move occurs because value has type `String`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value moved here
|
|
|
|
| value used here after move
|
2022-10-26 06:41:57 -05:00
|
|
|
-Ztrack-diagnostics: created at compiler/rustc_borrowck/src/borrowck_errors.rs:LL:CC
|
2022-11-03 17:10:29 -05:00
|
|
|
|
|
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
|
|
|
|
|
2022-11-15 11:01:20 -06:00
|
|
|
LL | let ref _moved @ ref _from = String::from("foo");
|
|
|
|
| +++ +++
|
2022-10-24 16:19:48 -05:00
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2022-10-24 16:19:48 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|