diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-12567.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-12567.rs b/src/test/ui/issues/issue-12567.rs new file mode 100644 index 000000000..1b2a37de4 --- /dev/null +++ b/src/test/ui/issues/issue-12567.rs @@ -0,0 +1,13 @@ +fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) { + match (l1, l2) { + //~^ ERROR: cannot move out of type `[T]`, a non-copy slice + //~| ERROR: cannot move out of type `[T]`, a non-copy slice + (&[], &[]) => println!("both empty"), + (&[], &[hd, ..]) | (&[hd, ..], &[]) + => println!("one empty"), + (&[hd1, ..], &[hd2, ..]) + => println!("both nonempty"), + } +} + +fn main() {} |