2014-05-20 23:44:22 -05:00
|
|
|
fn match_vecs<'a, T>(l1: &'a [T], l2: &'a [T]) {
|
|
|
|
match (l1, l2) {
|
2019-04-22 02:40:08 -05:00
|
|
|
//~^ ERROR: cannot move out of type `[T]`, a non-copy slice
|
|
|
|
//~| ERROR: cannot move out of type `[T]`, a non-copy slice
|
2016-03-11 04:54:59 -06:00
|
|
|
(&[], &[]) => println!("both empty"),
|
|
|
|
(&[], &[hd, ..]) | (&[hd, ..], &[])
|
|
|
|
=> println!("one empty"),
|
|
|
|
(&[hd1, ..], &[hd2, ..])
|
|
|
|
=> println!("both nonempty"),
|
2014-05-20 23:44:22 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|