rust/src/test/compile-fail/noncopyable-match-pattern.rs

10 lines
216 B
Rust
Raw Normal View History

2012-08-24 14:26:07 -05:00
fn main() {
let x = Some(private::exclusive(false));
2012-08-24 14:26:07 -05:00
match x {
2012-08-20 14:23:37 -05:00
Some(copy z) => { //~ ERROR copying a noncopyable value
2012-08-24 14:26:07 -05:00
do z.with |b| { assert !*b; }
}
2012-08-20 14:23:37 -05:00
None => fail
2012-08-24 14:26:07 -05:00
}
}