aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/display.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/display.rs
parentad20f00844cec9c794e34869be163673ebbed182 (diff)
Binders::subst -> substitute
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r--crates/hir_ty/src/display.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 2e178e5a8..704504b02 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -352,7 +352,7 @@ impl HirDisplay for Ty {
352 let data = (*datas) 352 let data = (*datas)
353 .as_ref() 353 .as_ref()
354 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 354 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
355 let bounds = data.subst(parameters); 355 let bounds = data.substitute(parameters);
356 bounds.into_value_and_skipped_binders().0 356 bounds.into_value_and_skipped_binders().0
357 } else { 357 } else {
358 Vec::new() 358 Vec::new()
@@ -397,7 +397,7 @@ impl HirDisplay for Ty {
397 } 397 }
398 TyKind::FnDef(def, parameters) => { 398 TyKind::FnDef(def, parameters) => {
399 let def = from_chalk(f.db, *def); 399 let def = from_chalk(f.db, *def);
400 let sig = f.db.callable_item_signature(def).subst(parameters); 400 let sig = f.db.callable_item_signature(def).substitute(parameters);
401 match def { 401 match def {
402 CallableDefId::FunctionId(ff) => { 402 CallableDefId::FunctionId(ff) => {
403 write!(f, "fn {}", f.db.function_data(ff).name)? 403 write!(f, "fn {}", f.db.function_data(ff).name)?
@@ -482,7 +482,7 @@ impl HirDisplay for Ty {
482 (_, Some(default_parameter)) => { 482 (_, Some(default_parameter)) => {
483 let actual_default = default_parameter 483 let actual_default = default_parameter
484 .clone() 484 .clone()
485 .subst(&parameters.prefix(i)); 485 .substitute(&parameters.prefix(i));
486 if parameter.assert_ty_ref(&Interner) != &actual_default 486 if parameter.assert_ty_ref(&Interner) != &actual_default
487 { 487 {
488 default_from = i + 1; 488 default_from = i + 1;
@@ -542,7 +542,7 @@ impl HirDisplay for Ty {
542 let data = (*datas) 542 let data = (*datas)
543 .as_ref() 543 .as_ref()
544 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 544 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
545 let bounds = data.subst(&parameters); 545 let bounds = data.substitute(&parameters);
546 write_bounds_like_dyn_trait_with_prefix("impl", bounds.skip_binders(), f)?; 546 write_bounds_like_dyn_trait_with_prefix("impl", bounds.skip_binders(), f)?;
547 // FIXME: it would maybe be good to distinguish this from the alias type (when debug printing), and to show the substitution 547 // FIXME: it would maybe be good to distinguish this from the alias type (when debug printing), and to show the substitution
548 } 548 }
@@ -595,7 +595,7 @@ impl HirDisplay for Ty {
595 let bounds = 595 let bounds =
596 f.db.generic_predicates(id.parent) 596 f.db.generic_predicates(id.parent)
597 .into_iter() 597 .into_iter()
598 .map(|pred| pred.clone().subst(&substs)) 598 .map(|pred| pred.clone().substitute(&substs))
599 .filter(|wc| match &wc.skip_binders() { 599 .filter(|wc| match &wc.skip_binders() {
600 WhereClause::Implemented(tr) => { 600 WhereClause::Implemented(tr) => {
601 tr.self_type_parameter(&Interner) == self 601 tr.self_type_parameter(&Interner) == self
@@ -629,7 +629,7 @@ impl HirDisplay for Ty {
629 let data = (*datas) 629 let data = (*datas)
630 .as_ref() 630 .as_ref()
631 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone()); 631 .map(|rpit| rpit.impl_traits[idx as usize].bounds.clone());
632 let bounds = data.subst(&opaque_ty.substitution); 632 let bounds = data.substitute(&opaque_ty.substitution);
633 write_bounds_like_dyn_trait_with_prefix("impl", bounds.skip_binders(), f)?; 633 write_bounds_like_dyn_trait_with_prefix("impl", bounds.skip_binders(), f)?;
634 } 634 }
635 ImplTraitId::AsyncBlockTypeImplTrait(..) => { 635 ImplTraitId::AsyncBlockTypeImplTrait(..) => {