Skip to content

Commit 5bd7106

Browse files
committed
Add regression test for rust-lang#92069
1 parent e7730dc commit 5bd7106

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// issue #92069
2+
#![feature(let_else)]
3+
4+
fn main() {
5+
let nums = vec![5, 4, 3, 2, 1];
6+
let [x, y] = nums else { //~ ERROR expected an array or slice
7+
return;
8+
};
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0529]: expected an array or slice, found `Vec<{integer}>`
2+
--> $DIR/let-else-slicing-error.rs:6:9
3+
|
4+
LL | let [x, y] = nums else {
5+
| ^^^^^^ ---- help: consider slicing here: `nums[..]`
6+
| |
7+
| pattern cannot match with input type `Vec<{integer}>`
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0529`.

0 commit comments

Comments
 (0)