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

39 lines
1.2 KiB
Plaintext

error[E0382]: use of moved value: `x`
--> $DIR/ref-suggestion.rs:4:5
|
LL | let x = vec![1];
| - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
LL | let y = x;
| - value moved here
LL | x;
| ^ value used here after move
error[E0382]: use of moved value: `x`
--> $DIR/ref-suggestion.rs:8:5
|
LL | let x = vec![1];
| - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
LL | let mut y = x;
| - value moved here
LL | x;
| ^ value used here after move
error[E0382]: use of partially moved value: `x`
--> $DIR/ref-suggestion.rs:16:5
|
LL | (Some(y), ()) => {},
| - value partially moved here
...
LL | x;
| ^ value used here after partial move
|
= 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), ()) => {},
| ^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0382`.