about summary refs log tree commit diff
path: root/tests/ui/match/slice-move-out-error-12567.rs
blob: 3f9bf9c76cf3d38ea527d914bb57b36c8f63c620 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Regression test for https://github.com/rust-lang/rust/issues/12567

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() {}