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