From 30a339e038bfd94d8c91f79287be9b7db4f0cb4e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Mon, 5 Apr 2021 18:49:26 +0200 Subject: Add Interner parameter to Binders::substitute --- crates/hir_ty/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_ty/src/lib.rs') diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index e15840c9a..827317fce 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs @@ -130,9 +130,9 @@ impl Binders { impl Binders { /// Substitutes all variables. - pub fn substitute(self, subst: &Substitution) -> T { + pub fn substitute(self, interner: &Interner, subst: &Substitution) -> T { let (value, binders) = self.into_value_and_skipped_binders(); - assert_eq!(subst.len(&Interner), binders.len(&Interner)); + assert_eq!(subst.len(interner), binders.len(interner)); value.subst_bound_vars(subst) } } @@ -362,7 +362,7 @@ impl Ty { TyKind::FnDef(def, parameters) => { let callable_def = db.lookup_intern_callable_def((*def).into()); let sig = db.callable_item_signature(callable_def); - Some(sig.substitute(¶meters)) + Some(sig.substitute(&Interner, ¶meters)) } TyKind::Closure(.., substs) => { let sig_param = substs.at(&Interner, 0).assert_ty_ref(&Interner); @@ -436,7 +436,7 @@ impl Ty { let data = (*it) .as_ref() .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); - data.substitute(&opaque_ty.substitution) + data.substitute(&Interner, &opaque_ty.substitution) }) } // It always has an parameter for Future::Output type. @@ -455,7 +455,7 @@ impl Ty { let predicates = db .generic_predicates(id.parent) .into_iter() - .map(|pred| pred.clone().substitute(&substs)) + .map(|pred| pred.clone().substitute(&Interner, &substs)) .filter(|wc| match &wc.skip_binders() { WhereClause::Implemented(tr) => { tr.self_type_parameter(&Interner) == self -- cgit v1.2.3