Skip to content

Commit 26c7bfd

Browse files
committed
Skip match exhaustiveness checking if pattern type contains errors
1 parent 4981f00 commit 26c7bfd

File tree

1 file changed

+3
-0
lines changed
  • crates/hir-ty/src/diagnostics

1 file changed

+3
-0
lines changed

crates/hir-ty/src/diagnostics/expr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ impl ExprValidator {
196196
let Some(pat_ty) = self.infer.type_of_pat.get(arm.pat) else {
197197
return;
198198
};
199+
if pat_ty.contains_unknown() {
200+
return;
201+
}
199202

200203
// We only include patterns whose type matches the type
201204
// of the scrutinee expression. If we had an InvalidMatchArmPattern

0 commit comments

Comments
 (0)