1
Fork 0

Ensure that we don't try to access fields on a non-struct pattern type in diagnostic

Fix #135209.
This commit is contained in:
Esteban Küber 2025-01-07 22:06:58 +00:00
parent ad211ced81
commit 5f04f98c9a
3 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,7 @@
// Regression test for #135209.
// We ensure that we don't try to access fields on a non-struct pattern type.
fn main() {
if let Iterator::Item { .. } = 1 { //~ ERROR E0223
x //~ ERROR E0425
}
}