2022-10-24 21:19:48 +00:00
|
|
|
error[E0382]: use of moved value
|
2022-10-26 11:41:57 +00:00
|
|
|
--> $DIR/track2.rs:LL:CC
|
2022-10-24 21:19:48 +00: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 11:41:57 +00:00
|
|
|
-Ztrack-diagnostics: created at compiler/rustc_borrowck/src/borrowck_errors.rs:LL:CC
|
2022-11-03 22:10:29 +00:00
|
|
|
|
|
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
|
|
|
|
|
2022-11-15 17:01:20 +00:00
|
|
|
LL | let ref _moved @ ref _from = String::from("foo");
|
|
|
|
| +++ +++
|
2022-10-24 21:19:48 +00:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|