diff options
Diffstat (limited to 'tests/ui/moves/move-out-of-slice-1.rs')
-rw-r--r-- | tests/ui/moves/move-out-of-slice-1.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/moves/move-out-of-slice-1.rs b/tests/ui/moves/move-out-of-slice-1.rs new file mode 100644 index 000000000..982648f5b --- /dev/null +++ b/tests/ui/moves/move-out-of-slice-1.rs @@ -0,0 +1,11 @@ +#![feature(box_patterns)] + +struct A; + +fn main() { + let a: Box<[A]> = Box::new([A]); + match a { //~ ERROR cannot move out of type `[A]`, a non-copy slice + box [a] => {}, + _ => {} + } +} |