mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
Auto merge of #17534 - Veykril:skip-unknown-match-check, r=Veykril
fix: Skip match exhaustiveness checking if pattern type contains errors Should fix https://github.com/rust-lang/rust-analyzer/issues/17509, checking when errors are involved is generally a bad idea as the algorithm doesn't really expect error types in the first place I believe
This commit is contained in:
commit
848e0c4040
1 changed files with 3 additions and 0 deletions
|
@ -196,6 +196,9 @@ impl ExprValidator {
|
|||
let Some(pat_ty) = self.infer.type_of_pat.get(arm.pat) else {
|
||||
return;
|
||||
};
|
||||
if pat_ty.contains_unknown() {
|
||||
return;
|
||||
}
|
||||
|
||||
// We only include patterns whose type matches the type
|
||||
// of the scrutinee expression. If we had an InvalidMatchArmPattern
|
||||
|
|
Loading…
Reference in a new issue