diff options
author | Florian Diebold <[email protected]> | 2021-04-05 17:49:26 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-05 18:21:01 +0100 |
commit | 30a339e038bfd94d8c91f79287be9b7db4f0cb4e (patch) | |
tree | 7e026ded541b94f2908d61a8037ed62f2df91625 /crates/hir_ty/src/infer/path.rs | |
parent | 05eba0db3dd76f016aabdd49af6211e70a1812ed (diff) |
Add Interner parameter to Binders::substitute
Diffstat (limited to 'crates/hir_ty/src/infer/path.rs')
-rw-r--r-- | crates/hir_ty/src/infer/path.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_ty/src/infer/path.rs b/crates/hir_ty/src/infer/path.rs index 5e3a45766..14f705173 100644 --- a/crates/hir_ty/src/infer/path.rs +++ b/crates/hir_ty/src/infer/path.rs | |||
@@ -81,9 +81,9 @@ impl<'a> InferenceContext<'a> { | |||
81 | ValueNs::ImplSelf(impl_id) => { | 81 | ValueNs::ImplSelf(impl_id) => { |
82 | let generics = crate::utils::generics(self.db.upcast(), impl_id.into()); | 82 | let generics = crate::utils::generics(self.db.upcast(), impl_id.into()); |
83 | let substs = generics.type_params_subst(self.db); | 83 | let substs = generics.type_params_subst(self.db); |
84 | let ty = self.db.impl_self_ty(impl_id).substitute(&substs); | 84 | let ty = self.db.impl_self_ty(impl_id).substitute(&Interner, &substs); |
85 | if let Some((AdtId::StructId(struct_id), substs)) = ty.as_adt() { | 85 | if let Some((AdtId::StructId(struct_id), substs)) = ty.as_adt() { |
86 | let ty = self.db.value_ty(struct_id.into()).substitute(&substs); | 86 | let ty = self.db.value_ty(struct_id.into()).substitute(&Interner, &substs); |
87 | return Some(ty); | 87 | return Some(ty); |
88 | } else { | 88 | } else { |
89 | // FIXME: diagnostic, invalid Self reference | 89 | // FIXME: diagnostic, invalid Self reference |
@@ -243,7 +243,8 @@ impl<'a> InferenceContext<'a> { | |||
243 | let impl_substs = TyBuilder::subst_for_def(self.db, impl_id) | 243 | let impl_substs = TyBuilder::subst_for_def(self.db, impl_id) |
244 | .fill(iter::repeat_with(|| self.table.new_type_var())) | 244 | .fill(iter::repeat_with(|| self.table.new_type_var())) |
245 | .build(); | 245 | .build(); |
246 | let impl_self_ty = self.db.impl_self_ty(impl_id).substitute(&impl_substs); | 246 | let impl_self_ty = |
247 | self.db.impl_self_ty(impl_id).substitute(&Interner, &impl_substs); | ||
247 | self.unify(&impl_self_ty, &ty); | 248 | self.unify(&impl_self_ty, &ty); |
248 | Some(impl_substs) | 249 | Some(impl_substs) |
249 | } | 250 | } |