1 // Regression test for #87017.
6 fn foo() -> Vec<i32> { vec![1, 2, 3] }
8 if let [_, _, _] = foo()[..] {}
9 //~^ ERROR: expected an array or slice
10 //~| HELP: consider slicing here
12 if let [] = &foo()[..] {}
13 //~^ ERROR: expected an array or slice
14 //~| HELP: consider slicing here
16 if let [] = foo()[..] {}
17 //~^ ERROR: expected an array or slice
18 //~| HELP: consider slicing here
22 //~^ HELP: consider slicing here
24 //~^ ERROR: expected an array or slice
28 let [..] = vec![1, 2, 3][..];
29 //~^ ERROR: expected an array or slice
30 //~| HELP: consider slicing here