aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-05 17:39:53 +0100
committerFlorian Diebold <[email protected]>2021-04-05 18:20:28 +0100
commit05eba0db3dd76f016aabdd49af6211e70a1812ed (patch)
tree4e4cdc0d7acddd8feb04c064360e0a8e889e4957 /crates/hir_ty/src/lib.rs
parentad20f00844cec9c794e34869be163673ebbed182 (diff)
Binders::subst -> substitute
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 86973c7ed..e15840c9a 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -130,7 +130,7 @@ impl<T> Binders<T> {
130 130
131impl<T: TypeWalk> Binders<T> { 131impl<T: TypeWalk> Binders<T> {
132 /// Substitutes all variables. 132 /// Substitutes all variables.
133 pub fn subst(self, subst: &Substitution) -> T { 133 pub fn substitute(self, subst: &Substitution) -> T {
134 let (value, binders) = self.into_value_and_skipped_binders(); 134 let (value, binders) = self.into_value_and_skipped_binders();
135 assert_eq!(subst.len(&Interner), binders.len(&Interner)); 135 assert_eq!(subst.len(&Interner), binders.len(&Interner));
136 value.subst_bound_vars(subst) 136 value.subst_bound_vars(subst)
@@ -362,7 +362,7 @@ impl Ty {
362 TyKind::FnDef(def, parameters) => { 362 TyKind::FnDef(def, parameters) => {
363 let callable_def = db.lookup_intern_callable_def((*def).into()); 363 let callable_def = db.lookup_intern_callable_def((*def).into());
364 let sig = db.callable_item_signature(callable_def); 364 let sig = db.callable_item_signature(callable_def);
365 Some(sig.subst(&parameters)) 365 Some(sig.substitute(&parameters))
366 } 366 }
367 TyKind::Closure(.., substs) => { 367 TyKind::Closure(.., substs) => {
368 let sig_param = substs.at(&Interner, 0).assert_ty_ref(&Interner); 368 let sig_param = substs.at(&Interner, 0).assert_ty_ref(&Interner);
@@ -436,7 +436,7 @@ impl Ty {
436 let data = (*it) 436 let data = (*it)
437 .as_ref() 437 .as_ref()
438 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 438 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
439 data.subst(&opaque_ty.substitution) 439 data.substitute(&opaque_ty.substitution)
440 }) 440 })
441 } 441 }
442 // It always has an parameter for Future::Output type. 442 // It always has an parameter for Future::Output type.
@@ -455,7 +455,7 @@ impl Ty {
455 let predicates = db 455 let predicates = db
456 .generic_predicates(id.parent) 456 .generic_predicates(id.parent)
457 .into_iter() 457 .into_iter()
458 .map(|pred| pred.clone().subst(&substs)) 458 .map(|pred| pred.clone().substitute(&substs))
459 .filter(|wc| match &wc.skip_binders() { 459 .filter(|wc| match &wc.skip_binders() {
460 WhereClause::Implemented(tr) => { 460 WhereClause::Implemented(tr) => {
461 tr.self_type_parameter(&Interner) == self 461 tr.self_type_parameter(&Interner) == self