aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-03 19:22:59 +0100
committerFlorian Diebold <[email protected]>2021-04-04 12:16:38 +0100
commitb0fe3d929f6f8764f371970b9f9ca9e7c415dafd (patch)
tree384bd17e3428b591f1c82d1b061ceecee529c044 /crates/hir_ty/src/diagnostics
parentb15152c430237d6850ec709ac75aab269c4b7dee (diff)
Add TyBuilder::unit() and TyExt::is_unit()
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r--crates/hir_ty/src/diagnostics/expr.rs4
1 files changed, 2 insertions, 2 deletions
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::{
15 MissingPatFields, RemoveThisSemicolon, 15 MissingPatFields, RemoveThisSemicolon,
16 }, 16 },
17 utils::variant_data, 17 utils::variant_data,
18 AdtId, InferenceResult, Interner, Ty, TyKind, 18 AdtId, InferenceResult, Interner, TyExt, TyKind,
19}; 19};
20 20
21pub(crate) use hir_def::{ 21pub(crate) use hir_def::{
@@ -423,7 +423,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
423 None => return, 423 None => return,
424 }; 424 };
425 425
426 if mismatch.actual != Ty::unit() || mismatch.expected != *possible_tail_ty { 426 if !mismatch.actual.is_unit() || mismatch.expected != *possible_tail_ty {
427 return; 427 return;
428 } 428 }
429 429