fork/rust

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

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

master
1.1 KiB33 linesraw
1error[E0382]: use of partially moved value: `s`
2  --> $DIR/move-in-pattern.rs:19:9
3   |
4LL |     if let Some(x) = s {
5   |                 - value partially moved here
6...
7LL |     foo(s);
8   |         ^ value used here after partial move
9   |
10   = note: partial move occurs because value has type `S`, which does not implement the `Copy` trait
11help: borrow this binding in the pattern to avoid moving the value
12   |
13LL |     if let Some(ref x) = s {
14   |                 +++
15
16error[E0382]: use of partially moved value: `e`
17  --> $DIR/move-in-pattern.rs:23:9
18   |
19LL |     let E::V { s: x } = e;
20   |                   - value partially moved here
21LL |     let _ = x;
22LL |     bar(e);
23   |         ^ value used here after partial move
24   |
25   = note: partial move occurs because value has type `S`, which does not implement the `Copy` trait
26help: borrow this binding in the pattern to avoid moving the value
27   |
28LL |     let E::V { s: ref x } = e;
29   |                   +++
30
31error: aborting due to 2 previous errors
32
33For more information about this error, try `rustc --explain E0382`.