From b0fe3d929f6f8764f371970b9f9ca9e7c415dafd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 3 Apr 2021 20:22:59 +0200 Subject: Add TyBuilder::unit() and TyExt::is_unit() --- crates/hir_ty/src/diagnostics/expr.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/diagnostics') diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index ad1259b34..8169b759f 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs @@ -15,7 +15,7 @@ use crate::{ MissingPatFields, RemoveThisSemicolon, }, utils::variant_data, - AdtId, InferenceResult, Interner, Ty, TyKind, + AdtId, InferenceResult, Interner, TyExt, TyKind, }; pub(crate) use hir_def::{ @@ -423,7 +423,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { None => return, }; - if mismatch.actual != Ty::unit() || mismatch.expected != *possible_tail_ty { + if !mismatch.actual.is_unit() || mismatch.expected != *possible_tail_ty { return; } -- cgit v1.2.3