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.rs31
1 files changed, 16 insertions, 15 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 965476a05..1108e5a10 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -592,20 +592,21 @@ impl HirDisplay for Ty {
592 } 592 }
593 TypeParamProvenance::ArgumentImplTrait => { 593 TypeParamProvenance::ArgumentImplTrait => {
594 let substs = generics.type_params_subst(f.db); 594 let substs = generics.type_params_subst(f.db);
595 let bounds = f 595 let bounds =
596 .db 596 f.db.generic_predicates(id.parent)
597 .generic_predicates(id.parent) 597 .into_iter()
598 .into_iter() 598 .map(|pred| pred.clone().subst(&substs))
599 .map(|pred| pred.clone().subst(&substs)) 599 .filter(|wc| match &wc.skip_binders() {
600 .filter(|wc| match &wc.skip_binders() { 600 WhereClause::Implemented(tr) => {
601 WhereClause::Implemented(tr) => tr.self_type_parameter() == self, 601 tr.self_type_parameter(&Interner) == self
602 WhereClause::AliasEq(AliasEq { 602 }
603 alias: AliasTy::Projection(proj), 603 WhereClause::AliasEq(AliasEq {
604 ty: _, 604 alias: AliasTy::Projection(proj),
605 }) => proj.self_type_parameter(&Interner) == self, 605 ty: _,
606 _ => false, 606 }) => proj.self_type_parameter(&Interner) == self,
607 }) 607 _ => false,
608 .collect::<Vec<_>>(); 608 })
609 .collect::<Vec<_>>();
609 write_bounds_like_dyn_trait_with_prefix("impl", &bounds, f)?; 610 write_bounds_like_dyn_trait_with_prefix("impl", &bounds, f)?;
610 } 611 }
611 } 612 }
@@ -780,7 +781,7 @@ impl TraitRef {
780 return write!(f, "{}", TYPE_HINT_TRUNCATION); 781 return write!(f, "{}", TYPE_HINT_TRUNCATION);
781 } 782 }
782 783
783 self.self_type_parameter().hir_fmt(f)?; 784 self.self_type_parameter(&Interner).hir_fmt(f)?;
784 if use_as { 785 if use_as {
785 write!(f, " as ")?; 786 write!(f, " as ")?;
786 } else { 787 } else {