fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.5 KiB48 linesraw
1error[E0382]: use of moved value: `x`
2  --> $DIR/ref-suggestion.rs:4:5
3   |
4LL |     let x = vec![1];
5   |         - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
6LL |     let y = x;
7   |             - value moved here
8LL |     x;
9   |     ^ value used here after move
10   |
11help: consider cloning the value if the performance cost is acceptable
12   |
13LL |     let y = x.clone();
14   |              ++++++++
15
16error[E0382]: use of moved value: `x`
17  --> $DIR/ref-suggestion.rs:8:5
18   |
19LL |     let x = vec![1];
20   |         - move occurs because `x` has type `Vec<i32>`, which does not implement the `Copy` trait
21LL |     let mut y = x;
22   |                 - value moved here
23LL |     x;
24   |     ^ value used here after move
25   |
26help: consider cloning the value if the performance cost is acceptable
27   |
28LL |     let mut y = x.clone();
29   |                  ++++++++
30
31error[E0382]: use of partially moved value: `x`
32  --> $DIR/ref-suggestion.rs:16:5
33   |
34LL |         (Some(y), ()) => {},
35   |               - value partially moved here
36...
37LL |     x;
38   |     ^ value used here after partial move
39   |
40   = note: partial move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
41help: borrow this binding in the pattern to avoid moving the value
42   |
43LL |         (Some(ref y), ()) => {},
44   |               +++
45
46error: aborting due to 3 previous errors
47
48For more information about this error, try `rustc --explain E0382`.