]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/issue-31287-drop-in-guard.stderr
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / borrowck / issue-31287-drop-in-guard.stderr
1 error[E0382]: use of moved value: `a`
2   --> $DIR/issue-31287-drop-in-guard.rs:5:9
3    |
4 LL |     let a = Some("...".to_owned());
5    |         - move occurs because `a` has type `Option<String>`, which does not implement the `Copy` trait
6 LL |     let b = match a {
7 LL |         Some(_) if { drop(a); false } => None,
8    |                           - value moved here
9 LL |         x => x,
10    |         ^ value used here after move
11    |
12 help: consider cloning the value if the performance cost is acceptable
13    |
14 LL |         Some(_) if { drop(a.clone()); false } => None,
15    |                            ++++++++
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0382`.