diff options
Diffstat (limited to 'crates/hir_ty/src/infer/unify.rs')
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 3732d8ebd..c3d9e81c3 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs | |||
@@ -118,21 +118,10 @@ impl<'a, 'b> Canonicalizer<'a, 'b> { | |||
118 | 118 | ||
119 | impl<T: HasInterner<Interner = Interner>> Canonicalized<T> { | 119 | impl<T: HasInterner<Interner = Interner>> Canonicalized<T> { |
120 | pub(super) fn decanonicalize_ty(&self, ty: Ty) -> Ty { | 120 | pub(super) fn decanonicalize_ty(&self, ty: Ty) -> Ty { |
121 | ty.fold_binders( | 121 | crate::fold_free_vars(ty, |bound, _binders| { |
122 | &mut |ty, binders| { | 122 | let (v, k) = self.free_vars[bound.index]; |
123 | if let TyKind::BoundVar(bound) = ty.kind(&Interner) { | 123 | TyKind::InferenceVar(v, k).intern(&Interner) |
124 | if bound.debruijn >= binders { | 124 | }) |
125 | let (v, k) = self.free_vars[bound.index]; | ||
126 | TyKind::InferenceVar(v, k).intern(&Interner) | ||
127 | } else { | ||
128 | ty | ||
129 | } | ||
130 | } else { | ||
131 | ty | ||
132 | } | ||
133 | }, | ||
134 | DebruijnIndex::INNERMOST, | ||
135 | ) | ||
136 | } | 125 | } |
137 | 126 | ||
138 | pub(super) fn apply_solution( | 127 | pub(super) fn apply_solution( |