blob: 93364d2f6259e7c01b8c31d4c1cd5fb90a301ec7 [file] [log] [blame]
struct X(isize);
enum Enum {
Variant1,
Variant2
}
impl Drop for X {
fn drop(&mut self) {}
}
impl Drop for Enum {
fn drop(&mut self) {}
}
fn main() {
let foo = X(1);
drop(foo);
match foo {
X(1) => (), //~ ERROR use of moved value
_ => unreachable!()
}
let e = Enum::Variant2;
drop(e);
match e { //~ ERROR use of moved value
Enum::Variant1 => unreachable!(),
Enum::Variant2 => ()
}
}