2018-08-08 12:28:26 +00:00
|
|
|
error[E0382]: use of moved value: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/ref-suggestion.rs:4:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | let x = vec![1];
|
2020-09-02 07:40:56 +00:00
|
|
|
| - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let y = x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| - value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^ value used here after move
|
2022-11-03 04:22:24 +00:00
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
|
|
|
LL | let y = x.clone();
|
|
|
|
| ++++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/ref-suggestion.rs:8:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | let x = vec![1];
|
2020-09-02 07:40:56 +00:00
|
|
|
| - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
|
2018-08-08 12:28:26 +00:00
|
|
|
LL | let mut y = x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| - value moved here
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^ value used here after move
|
2022-11-03 04:22:24 +00:00
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
|
|
|
LL | let mut y = x.clone();
|
|
|
|
| ++++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
2020-08-08 17:16:43 +00:00
|
|
|
error[E0382]: use of partially moved value: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/ref-suggestion.rs:16:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | (Some(y), ()) => {},
|
2020-08-08 17:16:43 +00:00
|
|
|
| - value partially moved here
|
2018-08-08 12:28:26 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x;
|
2019-04-22 07:40:08 +00:00
|
|
|
| ^ value used here after partial move
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: partial move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
|
2022-11-03 04:22:24 +00:00
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
2020-06-20 05:45:09 +00:00
|
|
|
|
|
|
|
|
LL | (Some(ref y), ()) => {},
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|