rust/src/test/ui/ref-suggestion.stderr

39 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2018-08-08 14:28:26 +02:00
error[E0382]: use of moved value: `x`
2018-12-25 16:56:47 +01:00
--> $DIR/ref-suggestion.rs:4:5
2018-08-08 14:28:26 +02:00
|
LL | let x = vec![1];
| - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
2018-08-08 14:28:26 +02:00
LL | let y = x;
| - value moved here
2019-03-09 13:03:44 +01:00
LL | x;
2018-08-08 14:28:26 +02:00
| ^ value used here after move
error[E0382]: use of moved value: `x`
2018-12-25 16:56:47 +01:00
--> $DIR/ref-suggestion.rs:8:5
2018-08-08 14:28:26 +02:00
|
LL | let x = vec![1];
| - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
2018-08-08 14:28:26 +02:00
LL | let mut y = x;
| - value moved here
2019-03-09 13:03:44 +01:00
LL | x;
2018-08-08 14:28:26 +02:00
| ^ value used here after move
error[E0382]: use of partially moved value: `x`
2018-12-25 16:56:47 +01:00
--> $DIR/ref-suggestion.rs:16:5
2018-08-08 14:28:26 +02:00
|
LL | (Some(y), ()) => {},
| - value partially moved here
2018-08-08 14:28:26 +02:00
...
2019-03-09 13:03:44 +01:00
LL | x;
| ^ value used here after partial move
2018-08-08 14:28:26 +02:00
|
= note: partial move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
help: borrow this field in the pattern to avoid moving `x.0.0`
|
LL | (Some(ref y), ()) => {},
| ^^^
2018-08-08 14:28:26 +02:00
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0382`.