fork/rust

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

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

master
1.3 KiB36 linesraw
1error[E0382]: use of moved value: `s`
2  --> $DIR/issue-29723.rs:12:13
3   |
4LL |     let s = String::new();
5   |         - move occurs because `s` has type `String`, which does not implement the `Copy` trait
6LL |     let _s = match 0 {
7LL |         0 if { drop(s); false } => String::from("oops"),
8   |                     - value moved here
9...
10LL |             s
11   |             ^ value used here after move
12   |
13help: consider cloning the value if the performance cost is acceptable
14   |
15LL |         0 if { drop(s.clone()); false } => String::from("oops"),
16   |                      ++++++++
17
18error[E0382]: use of moved value: `s`
19  --> $DIR/issue-29723.rs:20:14
20   |
21LL |     let s = String::new();
22   |         - move occurs because `s` has type `String`, which does not implement the `Copy` trait
23LL |     let _s = match 0 {
24LL |         0 if let Some(()) = { drop(s); None } => String::from("oops"),
25   |                                    - value moved here
26LL |         _ => s
27   |              ^ value used here after move
28   |
29help: consider cloning the value if the performance cost is acceptable
30   |
31LL |         0 if let Some(()) = { drop(s.clone()); None } => String::from("oops"),
32   |                                     ++++++++
33
34error: aborting due to 2 previous errors
35
36For more information about this error, try `rustc --explain E0382`.