diff options
Diffstat (limited to 'crates/hir_ty/src/infer/unify.rs')
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 0efc62e53..d2496db3b 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs | |||
@@ -49,7 +49,7 @@ impl<'a, 'b> Canonicalizer<'a, 'b> { | |||
49 | 49 | ||
50 | fn do_canonicalize<T: TypeWalk>(&mut self, t: T, binders: DebruijnIndex) -> T { | 50 | fn do_canonicalize<T: TypeWalk>(&mut self, t: T, binders: DebruijnIndex) -> T { |
51 | t.fold_binders( | 51 | t.fold_binders( |
52 | &mut |ty, binders| match ty.interned(&Interner) { | 52 | &mut |ty, binders| match ty.kind(&Interner) { |
53 | &TyKind::InferenceVar(var, kind) => { | 53 | &TyKind::InferenceVar(var, kind) => { |
54 | let inner = var.to_inner(); | 54 | let inner = var.to_inner(); |
55 | if self.var_stack.contains(&inner) { | 55 | if self.var_stack.contains(&inner) { |
@@ -304,7 +304,7 @@ impl InferenceTable { | |||
304 | let ty1 = self.resolve_ty_shallow(ty1); | 304 | let ty1 = self.resolve_ty_shallow(ty1); |
305 | let ty2 = self.resolve_ty_shallow(ty2); | 305 | let ty2 = self.resolve_ty_shallow(ty2); |
306 | if ty1.equals_ctor(&ty2) { | 306 | if ty1.equals_ctor(&ty2) { |
307 | match (ty1.interned(&Interner), ty2.interned(&Interner)) { | 307 | match (ty1.kind(&Interner), ty2.kind(&Interner)) { |
308 | (TyKind::Adt(_, substs1), TyKind::Adt(_, substs2)) | 308 | (TyKind::Adt(_, substs1), TyKind::Adt(_, substs2)) |
309 | | (TyKind::FnDef(_, substs1), TyKind::FnDef(_, substs2)) | 309 | | (TyKind::FnDef(_, substs1), TyKind::FnDef(_, substs2)) |
310 | | ( | 310 | | ( |
@@ -329,7 +329,7 @@ impl InferenceTable { | |||
329 | } | 329 | } |
330 | 330 | ||
331 | pub(super) fn unify_inner_trivial(&mut self, ty1: &Ty, ty2: &Ty, depth: usize) -> bool { | 331 | pub(super) fn unify_inner_trivial(&mut self, ty1: &Ty, ty2: &Ty, depth: usize) -> bool { |
332 | match (ty1.interned(&Interner), ty2.interned(&Interner)) { | 332 | match (ty1.kind(&Interner), ty2.kind(&Interner)) { |
333 | (TyKind::Unknown, _) | (_, TyKind::Unknown) => true, | 333 | (TyKind::Unknown, _) | (_, TyKind::Unknown) => true, |
334 | 334 | ||
335 | (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true, | 335 | (TyKind::Placeholder(p1), TyKind::Placeholder(p2)) if *p1 == *p2 => true, |
@@ -458,7 +458,7 @@ impl InferenceTable { | |||
458 | if i > 0 { | 458 | if i > 0 { |
459 | cov_mark::hit!(type_var_resolves_to_int_var); | 459 | cov_mark::hit!(type_var_resolves_to_int_var); |
460 | } | 460 | } |
461 | match ty.interned(&Interner) { | 461 | match ty.kind(&Interner) { |
462 | TyKind::InferenceVar(tv, _) => { | 462 | TyKind::InferenceVar(tv, _) => { |
463 | let inner = tv.to_inner(); | 463 | let inner = tv.to_inner(); |
464 | match self.var_unification_table.inlined_probe_value(inner).known() { | 464 | match self.var_unification_table.inlined_probe_value(inner).known() { |
@@ -481,7 +481,7 @@ impl InferenceTable { | |||
481 | /// be resolved as far as possible, i.e. contain no type variables with | 481 | /// be resolved as far as possible, i.e. contain no type variables with |
482 | /// known type. | 482 | /// known type. |
483 | fn resolve_ty_as_possible_inner(&mut self, tv_stack: &mut Vec<TypeVarId>, ty: Ty) -> Ty { | 483 | fn resolve_ty_as_possible_inner(&mut self, tv_stack: &mut Vec<TypeVarId>, ty: Ty) -> Ty { |
484 | ty.fold(&mut |ty| match ty.interned(&Interner) { | 484 | ty.fold(&mut |ty| match ty.kind(&Interner) { |
485 | &TyKind::InferenceVar(tv, kind) => { | 485 | &TyKind::InferenceVar(tv, kind) => { |
486 | let inner = tv.to_inner(); | 486 | let inner = tv.to_inner(); |
487 | if tv_stack.contains(&inner) { | 487 | if tv_stack.contains(&inner) { |
@@ -508,7 +508,7 @@ impl InferenceTable { | |||
508 | /// Resolves the type completely; type variables without known type are | 508 | /// Resolves the type completely; type variables without known type are |
509 | /// replaced by TyKind::Unknown. | 509 | /// replaced by TyKind::Unknown. |
510 | fn resolve_ty_completely_inner(&mut self, tv_stack: &mut Vec<TypeVarId>, ty: Ty) -> Ty { | 510 | fn resolve_ty_completely_inner(&mut self, tv_stack: &mut Vec<TypeVarId>, ty: Ty) -> Ty { |
511 | ty.fold(&mut |ty| match ty.interned(&Interner) { | 511 | ty.fold(&mut |ty| match ty.kind(&Interner) { |
512 | &TyKind::InferenceVar(tv, kind) => { | 512 | &TyKind::InferenceVar(tv, kind) => { |
513 | let inner = tv.to_inner(); | 513 | let inner = tv.to_inner(); |
514 | if tv_stack.contains(&inner) { | 514 | if tv_stack.contains(&inner) { |