diff options
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index e4b1f92e4..90b5b17e2 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -518,6 +518,10 @@ impl<T> Binders<T> { | |||
518 | pub fn skip_binders(&self) -> &T { | 518 | pub fn skip_binders(&self) -> &T { |
519 | &self.value | 519 | &self.value |
520 | } | 520 | } |
521 | |||
522 | pub fn into_value_and_skipped_binders(self) -> (T, usize) { | ||
523 | (self.value, self.num_binders) | ||
524 | } | ||
521 | } | 525 | } |
522 | 526 | ||
523 | impl<T: Clone> Binders<&T> { | 527 | impl<T: Clone> Binders<&T> { |
@@ -985,7 +989,7 @@ impl Ty { | |||
985 | .generic_predicates(id.parent) | 989 | .generic_predicates(id.parent) |
986 | .into_iter() | 990 | .into_iter() |
987 | .map(|pred| pred.clone().subst(&substs)) | 991 | .map(|pred| pred.clone().subst(&substs)) |
988 | .filter(|wc| match &wc { | 992 | .filter(|wc| match &wc.skip_binders() { |
989 | WhereClause::Implemented(tr) => tr.self_type_parameter() == self, | 993 | WhereClause::Implemented(tr) => tr.self_type_parameter() == self, |
990 | WhereClause::AliasEq(AliasEq { | 994 | WhereClause::AliasEq(AliasEq { |
991 | alias: AliasTy::Projection(proj), | 995 | alias: AliasTy::Projection(proj), |
@@ -993,7 +997,6 @@ impl Ty { | |||
993 | }) => proj.self_type_parameter() == self, | 997 | }) => proj.self_type_parameter() == self, |
994 | _ => false, | 998 | _ => false, |
995 | }) | 999 | }) |
996 | .map(Binders::wrap_empty) | ||
997 | .collect_vec(); | 1000 | .collect_vec(); |
998 | 1001 | ||
999 | Some(predicates) | 1002 | Some(predicates) |