Propogate error types in mir type projections

This commit is contained in:
Lukas Wirth 2025-02-12 09:24:33 +01:00
parent 8aa4ae5e69
commit 5af2d6abea
2 changed files with 22 additions and 2 deletions

View file

@ -260,6 +260,19 @@ fn main() {
let arr = [1, 2, 3, 4, 5];
let [_x, _y @ ..] = arr;
}
"#,
);
}
// regression test as we used to panic in this scenario
#[test]
fn unknown_struct_pattern_param_type() {
check_diagnostics(
r#"
struct S { field : u32 }
fn f(S { field }: error) {
// ^^^^^ 💡 warn: unused variable
}
"#,
);
}