rust/src/test/compile-fail/bind-by-move-no-lvalues-1.rs

10 lines
227 B
Rust
Raw Normal View History

struct X { x: (); drop { error!("destructor runs"); } }
fn main() {
let x = some(X { x: () });
match x {
some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue
none => fail
}
}