]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-drop-from-guard.stderr
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / borrowck / borrowck-drop-from-guard.stderr
1 error[E0382]: use of moved value: `my_str`
2   --> $DIR/borrowck-drop-from-guard.rs:9:23
3    |
4 LL |     let my_str = "hello".to_owned();
5    |         ------ move occurs because `my_str` has type `String`, which does not implement the `Copy` trait
6 LL |     match Some(42) {
7 LL |         Some(_) if { drop(my_str); false } => {}
8    |                           ------ value moved here
9 LL |         Some(_) => {}
10 LL |         None => { foo(my_str); }
11    |                       ^^^^^^ value used here after move
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0382`.