summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/borrowck-drop-from-guard.stderr
blob: cd0d2fee9422fd4359de6779204ab52c443c2c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
error[E0382]: use of moved value: `my_str`
  --> $DIR/borrowck-drop-from-guard.rs:9:23
   |
LL |     let my_str = "hello".to_owned();
   |         ------ move occurs because `my_str` has type `String`, which does not implement the `Copy` trait
LL |     match Some(42) {
LL |         Some(_) if { drop(my_str); false } => {}
   |                           ------ value moved here
LL |         Some(_) => {}
LL |         None => { foo(my_str); }
   |                       ^^^^^^ value used here after move

error: aborting due to previous error

For more information about this error, try `rustc --explain E0382`.