aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/unify.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/infer/unify.rs')
-rw-r--r--crates/hir_ty/src/infer/unify.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs
index b7bc48569..8370f2e1c 100644
--- a/crates/hir_ty/src/infer/unify.rs
+++ b/crates/hir_ty/src/infer/unify.rs
@@ -214,7 +214,7 @@ impl TypeVariableTable {
214 fn fallback_value(&self, iv: InferenceVar, kind: TyVariableKind) -> Ty { 214 fn fallback_value(&self, iv: InferenceVar, kind: TyVariableKind) -> Ty {
215 match kind { 215 match kind {
216 _ if self.inner[iv.to_inner().0 as usize].diverging => TyKind::Never, 216 _ if self.inner[iv.to_inner().0 as usize].diverging => TyKind::Never,
217 TyVariableKind::General => TyKind::Unknown, 217 TyVariableKind::General => TyKind::Error,
218 TyVariableKind::Integer => TyKind::Scalar(Scalar::Int(IntTy::I32)), 218 TyVariableKind::Integer => TyKind::Scalar(Scalar::Int(IntTy::I32)),
219 TyVariableKind::Float => TyKind::Scalar(Scalar::Float(FloatTy::F64)), 219 TyVariableKind::Float => TyKind::Scalar(Scalar::Float(FloatTy::F64)),
220 } 220 }
@@ -327,7 +327,7 @@ impl InferenceTable {
327 327
328 pub(super) fn unify_inner_trivial(&mut self, ty1: &Ty, ty2: &Ty, depth: usize) -> bool { 328 pub(super) fn unify_inner_trivial(&mut self, ty1: &Ty, ty2: &Ty, depth: usize) -> bool {
329 match (ty1.kind(&Interner), ty2.kind(&Interner)) { 329 match (ty1.kind(&Interner), ty2.kind(&Interner)) {
330 (TyKind::Unknown, _) | (_, TyKind::Unknown) => true, 330 (TyKind::Error, _) | (_, TyKind::Error) => true,
331 331
332 (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true, 332 (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true,
333 333