aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r--crates/hir_ty/src/display.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 1108e5a10..f31e6b108 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -352,8 +352,8 @@ 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(&Interner, parameters);
356 bounds.value 356 bounds.into_value_and_skipped_binders().0
357 } else { 357 } else {
358 Vec::new() 358 Vec::new()
359 } 359 }
@@ -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(&Interner, 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(&Interner, &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,8 +542,8 @@ 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(&Interner, &parameters);
546 write_bounds_like_dyn_trait_with_prefix("impl", &bounds.value, 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 }
549 ImplTraitId::AsyncBlockTypeImplTrait(..) => { 549 ImplTraitId::AsyncBlockTypeImplTrait(..) => {
@@ -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(&Interner, &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,8 +629,8 @@ 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(&Interner, &opaque_ty.substitution);
633 write_bounds_like_dyn_trait_with_prefix("impl", &bounds.value, f)?; 633 write_bounds_like_dyn_trait_with_prefix("impl", bounds.skip_binders(), f)?;
634 } 634 }
635 ImplTraitId::AsyncBlockTypeImplTrait(..) => { 635 ImplTraitId::AsyncBlockTypeImplTrait(..) => {
636 write!(f, "{{async block}}")?; 636 write!(f, "{{async block}}")?;