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

10 lines
216 B
Rust

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