aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/display.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-03-21 16:40:14 +0000
committerFlorian Diebold <[email protected]>2021-03-21 17:01:14 +0000
commit1d5c4a77fb33cab7bf8f9d2edc6dd26b09ef65f3 (patch)
tree9cc37c708ec3c2df8adbc1e96204c7a7e2e3ca65 /crates/hir_ty/src/display.rs
parent590c41635952e19c3caae525a827499dbd360049 (diff)
Use QuantifiedWhereClause in generic_predicates as well
Still far too much binder skipping going on; I find it hard to imagine this is all correct, but the tests pass.
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r--crates/hir_ty/src/display.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 372671405..cc6b93d37 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -581,7 +581,7 @@ impl HirDisplay for Ty {
581 .generic_predicates(id.parent) 581 .generic_predicates(id.parent)
582 .into_iter() 582 .into_iter()
583 .map(|pred| pred.clone().subst(&substs)) 583 .map(|pred| pred.clone().subst(&substs))
584 .filter(|wc| match &wc { 584 .filter(|wc| match &wc.skip_binders() {
585 WhereClause::Implemented(tr) => tr.self_type_parameter() == self, 585 WhereClause::Implemented(tr) => tr.self_type_parameter() == self,
586 WhereClause::AliasEq(AliasEq { 586 WhereClause::AliasEq(AliasEq {
587 alias: AliasTy::Projection(proj), 587 alias: AliasTy::Projection(proj),
@@ -590,15 +590,7 @@ impl HirDisplay for Ty {
590 _ => false, 590 _ => false,
591 }) 591 })
592 .collect::<Vec<_>>(); 592 .collect::<Vec<_>>();
593 write_bounds_like_dyn_trait_with_prefix( 593 write_bounds_like_dyn_trait_with_prefix("impl", &bounds, f)?;
594 "impl",
595 &bounds
596 .iter()
597 .cloned()
598 .map(crate::Binders::wrap_empty)
599 .collect::<Vec<_>>(),
600 f,
601 )?;
602 } 594 }
603 } 595 }
604 } 596 }