Add a compile-fail test for #3255
This commit is contained in:
parent
37bcd67a09
commit
d09fd6561f
9
src/test/compile-fail/noncopyable-match-pattern.rs
Normal file
9
src/test/compile-fail/noncopyable-match-pattern.rs
Normal file
@ -0,0 +1,9 @@
|
||||
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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user