rust/src/test/compile-fail/bind-by-move-no-guards.rs
2012-08-26 15:56:16 -07:00

11 lines
277 B
Rust

fn main() {
let (c,p) = pipes::stream();
let x = Some(p);
c.send(false);
match move x {
Some(move z) if z.recv() => { fail }, //~ ERROR cannot bind by-move into a pattern guard
Some(move z) => { assert !z.recv(); },
None => fail
}
}