Add regression test for #92069
This commit is contained in:
parent
e7730dcb7e
commit
5bd71063b3
2 changed files with 20 additions and 0 deletions
9
src/test/ui/let-else/let-else-slicing-error.rs
Normal file
9
src/test/ui/let-else/let-else-slicing-error.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
// issue #92069
|
||||
#![feature(let_else)]
|
||||
|
||||
fn main() {
|
||||
let nums = vec![5, 4, 3, 2, 1];
|
||||
let [x, y] = nums else { //~ ERROR expected an array or slice
|
||||
return;
|
||||
};
|
||||
}
|
11
src/test/ui/let-else/let-else-slicing-error.stderr
Normal file
11
src/test/ui/let-else/let-else-slicing-error.stderr
Normal file
|
@ -0,0 +1,11 @@
|
|||
error[E0529]: expected an array or slice, found `Vec<{integer}>`
|
||||
--> $DIR/let-else-slicing-error.rs:6:9
|
||||
|
|
||||
LL | let [x, y] = nums else {
|
||||
| ^^^^^^ ---- help: consider slicing here: `nums[..]`
|
||||
| |
|
||||
| pattern cannot match with input type `Vec<{integer}>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0529`.
|
Loading…
Add table
Reference in a new issue