rust/tests/ui/nll/ref-suggestion.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.5 KiB
Plaintext
Raw Normal View History

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
|
LL | let x = vec![1];
| - 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;
| - 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
|
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
|
LL | let x = vec![1];
| - 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;
| - 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
|
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
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), ()) => {},
| - value partially moved here
2018-08-08 12:28:26 +00:00
...
2019-03-09 12:03:44 +00:00
LL | x;
| ^ value used here after partial move
2018-08-08 12:28:26 +00:00
|
= note: partial move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | (Some(ref y), ()) => {},
| +++
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`.