Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/display.rs')
-rw-r--r--crates/hir-ty/src/display.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/hir-ty/src/display.rs b/crates/hir-ty/src/display.rs
index b3760e3a38..f0e31ebd02 100644
--- a/crates/hir-ty/src/display.rs
+++ b/crates/hir-ty/src/display.rs
@@ -620,19 +620,19 @@ impl HirDisplay for ProjectionTy {
.generic_predicates(id.parent)
.iter()
.map(|pred| pred.clone().substitute(Interner, &substs))
- .filter(|wc| match wc.skip_binders() {
- WhereClause::Implemented(tr) => {
- matches!(
- tr.self_type_parameter(Interner).kind(Interner),
- TyKind::Alias(_)
- )
- }
- WhereClause::TypeOutlives(t) => {
- matches!(t.ty.kind(Interner), TyKind::Alias(_))
- }
- // We shouldn't be here if these exist
- WhereClause::AliasEq(_) => false,
- WhereClause::LifetimeOutlives(_) => false,
+ .filter(|wc| {
+ let ty = match wc.skip_binders() {
+ WhereClause::Implemented(tr) => tr.self_type_parameter(Interner),
+ WhereClause::TypeOutlives(t) => t.ty.clone(),
+ // We shouldn't be here if these exist
+ WhereClause::AliasEq(_) | WhereClause::LifetimeOutlives(_) => {
+ return false;
+ }
+ };
+ let TyKind::Alias(AliasTy::Projection(proj)) = ty.kind(Interner) else {
+ return false;
+ };
+ proj == self
})
.collect::<Vec<_>>();
if !bounds.is_empty() {