diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r-- | crates/hir_ty/src/diagnostics/expr.rs | 2 | ||||
-rw-r--r-- | crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index b809b96a0..dc8f20138 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs | |||
@@ -56,7 +56,7 @@ impl BodyValidationDiagnostic { | |||
56 | pub fn collect(db: &dyn HirDatabase, owner: DefWithBodyId) -> Vec<BodyValidationDiagnostic> { | 56 | pub fn collect(db: &dyn HirDatabase, owner: DefWithBodyId) -> Vec<BodyValidationDiagnostic> { |
57 | let _p = profile::span("BodyValidationDiagnostic::collect"); | 57 | let _p = profile::span("BodyValidationDiagnostic::collect"); |
58 | let infer = db.infer(owner); | 58 | let infer = db.infer(owner); |
59 | let mut validator = ExprValidator::new(owner, infer.clone()); | 59 | let mut validator = ExprValidator::new(owner, infer); |
60 | validator.validate_body(db); | 60 | validator.validate_body(db); |
61 | validator.diagnostics | 61 | validator.diagnostics |
62 | } | 62 | } |
diff --git a/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs b/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs index 471cd4921..e3d640a79 100644 --- a/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs +++ b/crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs | |||
@@ -84,10 +84,7 @@ impl IntRange { | |||
84 | #[inline] | 84 | #[inline] |
85 | fn is_integral(ty: &Ty) -> bool { | 85 | fn is_integral(ty: &Ty) -> bool { |
86 | match ty.kind(&Interner) { | 86 | match ty.kind(&Interner) { |
87 | TyKind::Scalar(Scalar::Char) | 87 | TyKind::Scalar(Scalar::Char | Scalar::Int(_) | Scalar::Uint(_) | Scalar::Bool) => true, |
88 | | TyKind::Scalar(Scalar::Int(_)) | ||
89 | | TyKind::Scalar(Scalar::Uint(_)) | ||
90 | | TyKind::Scalar(Scalar::Bool) => true, | ||
91 | _ => false, | 88 | _ => false, |
92 | } | 89 | } |
93 | } | 90 | } |
@@ -381,7 +378,7 @@ impl Constructor { | |||
381 | // Wildcards cover anything | 378 | // Wildcards cover anything |
382 | (_, Wildcard) => true, | 379 | (_, Wildcard) => true, |
383 | // The missing ctors are not covered by anything in the matrix except wildcards. | 380 | // The missing ctors are not covered by anything in the matrix except wildcards. |
384 | (Missing, _) | (Wildcard, _) => false, | 381 | (Missing | Wildcard, _) => false, |
385 | 382 | ||
386 | (Single, Single) => true, | 383 | (Single, Single) => true, |
387 | (Variant(self_id), Variant(other_id)) => self_id == other_id, | 384 | (Variant(self_id), Variant(other_id)) => self_id == other_id, |
@@ -523,7 +520,7 @@ impl SplitWildcard { | |||
523 | } | 520 | } |
524 | } | 521 | } |
525 | TyKind::Scalar(Scalar::Char) => unhandled(), | 522 | TyKind::Scalar(Scalar::Char) => unhandled(), |
526 | TyKind::Scalar(Scalar::Int(..)) | TyKind::Scalar(Scalar::Uint(..)) => unhandled(), | 523 | TyKind::Scalar(Scalar::Int(..) | Scalar::Uint(..)) => unhandled(), |
527 | TyKind::Never if !cx.feature_exhaustive_patterns() && !pcx.is_top_level => { | 524 | TyKind::Never if !cx.feature_exhaustive_patterns() && !pcx.is_top_level => { |
528 | smallvec![NonExhaustive] | 525 | smallvec![NonExhaustive] |
529 | } | 526 | } |