rust/src/test/compile-fail/noncopyable-match-pattern.rs
2012-08-26 15:56:16 -07:00

9 lines
215 B
Rust

fn main() {
let x = Some(unsafe::exclusive(false));
match x {
Some(copy z) => { //~ ERROR copying a noncopyable value
do z.with |b| { assert !*b; }
}
None => fail
}
}