diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index fb76e2e4ec..278a4b9472 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs @@ -223,10 +223,10 @@ impl<'a, 'b> ExprValidator<'a, 'b> { db.body_with_source_map(self.owner.into()); let match_expr_ty = match infer.type_of_expr.get(match_expr) { - Some(ty) => ty, // If we can't resolve the type of the match expression // we cannot perform exhaustiveness checks. - None => return, + None | Some(Ty::Unknown) => return, + Some(ty) => ty, }; let cx = MatchCheckCtx { match_expr, body, infer: infer.clone(), db }; diff --git a/crates/hir_ty/src/diagnostics/match_check.rs b/crates/hir_ty/src/diagnostics/match_check.rs index 1602c3fb4c..5bd03f2ac0 100644 --- a/crates/hir_ty/src/diagnostics/match_check.rs +++ b/crates/hir_ty/src/diagnostics/match_check.rs @@ -1342,12 +1342,10 @@ fn panic(a: Category, b: Category) { enum Option { Some(T), None } fn main() { - // FIXME: This is a false positive, as the `Never` type is not known here. // `Never` is deliberately not defined so that it's an uninferred type. match Option::::None { None => (), Some(never) => match never {}, - // ^^^^^ Missing match arm } } "#,