mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
Propogate error types in mir type projections
This commit is contained in:
parent
8aa4ae5e69
commit
5af2d6abea
2 changed files with 22 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue