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

@ -236,11 +236,7 @@ impl HirDisplay for TypeParam {
write!(f, "{}", self.name(f.db))?;
let bounds = f.db.generic_predicates_for_param(self.id);
let substs = Substitution::type_params(f.db, self.id.parent);
let predicates = bounds
.iter()
.cloned()
.map(|b| hir_ty::Binders::new(0, b.subst(&substs)))
.collect::<Vec<_>>();
let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::<Vec<_>>();
if !(predicates.is_empty() || f.omit_verbose_types()) {
write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?;
}