diff options
author | Florian Diebold <[email protected]> | 2021-04-05 18:01:41 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-05 18:21:03 +0100 |
commit | fbab69cbffed37291b463c0e57fade49581e1de2 (patch) | |
tree | c7c21751708e37b84a4720ebdfaf6e50d99b1ab5 /crates/hir_ty/src/infer | |
parent | e28f0c98ba449c372ffcc450ac756f0adbdf9549 (diff) |
Get rid of subst_bound_vars uses
Diffstat (limited to 'crates/hir_ty/src/infer')
-rw-r--r-- | crates/hir_ty/src/infer/unify.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 06187df56..c90a16720 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs | |||
@@ -152,7 +152,7 @@ impl<T> Canonicalized<T> { | |||
152 | // eagerly replace projections in the type; we may be getting types | 152 | // eagerly replace projections in the type; we may be getting types |
153 | // e.g. from where clauses where this hasn't happened yet | 153 | // e.g. from where clauses where this hasn't happened yet |
154 | let ty = ctx.normalize_associated_types_in( | 154 | let ty = ctx.normalize_associated_types_in( |
155 | ty.assert_ty_ref(&Interner).clone().subst_bound_vars(&new_vars), | 155 | new_vars.apply(ty.assert_ty_ref(&Interner).clone(), &Interner), |
156 | ); | 156 | ); |
157 | ctx.table.unify(&TyKind::InferenceVar(v, k).intern(&Interner), &ty); | 157 | ctx.table.unify(&TyKind::InferenceVar(v, k).intern(&Interner), &ty); |
158 | } | 158 | } |
@@ -173,8 +173,8 @@ pub(crate) fn unify(tys: &Canonical<(Ty, Ty)>) -> Option<Substitution> { | |||
173 | // fallback to Unknown in the end (kind of hacky, as below) | 173 | // fallback to Unknown in the end (kind of hacky, as below) |
174 | .map(|_| table.new_type_var()), | 174 | .map(|_| table.new_type_var()), |
175 | ); | 175 | ); |
176 | let ty1_with_vars = tys.value.0.clone().subst_bound_vars(&vars); | 176 | let ty1_with_vars = vars.apply(tys.value.0.clone(), &Interner); |
177 | let ty2_with_vars = tys.value.1.clone().subst_bound_vars(&vars); | 177 | let ty2_with_vars = vars.apply(tys.value.1.clone(), &Interner); |
178 | if !table.unify(&ty1_with_vars, &ty2_with_vars) { | 178 | if !table.unify(&ty1_with_vars, &ty2_with_vars) { |
179 | return None; | 179 | return None; |
180 | } | 180 | } |