summary refs log tree commit diff
path: root/src/test/ui/issues/issue-12567.rs
blob: 1e1debe31ce6dac4a1b5ee3bf15418756463d86d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![feature(slice_patterns)]

fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
    match (l1, l2) {
        (&[], &[]) => println!("both empty"),
        (&[], &[hd, ..]) | (&[hd, ..], &[])
            => println!("one empty"),
        //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
        //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
        (&[hd1, ..], &[hd2, ..])
            => println!("both nonempty"),
        //~^^ ERROR: cannot move out of type `[T]`, a non-copy slice
        //~^^^ ERROR: cannot move out of type `[T]`, a non-copy slice
    }
}

fn main() {}