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.
This commit is contained in:
Florian Diebold 2021-03-21 17:40:14 +01:00
parent 590c416359
commit 1d5c4a77fb
9 changed files with 28 additions and 37 deletions

View file

@ -1460,7 +1460,7 @@ impl TypeParam {
pub fn trait_bounds(self, db: &dyn HirDatabase) -> Vec<Trait> {
db.generic_predicates_for_param(self.id)
.into_iter()
.filter_map(|pred| match &pred.value {
.filter_map(|pred| match &pred.skip_binders().skip_binders() {
hir_ty::WhereClause::Implemented(trait_ref) => {
Some(Trait::from(trait_ref.hir_trait_id()))
}