Introduce QuantifiedWhereClause and DynTy analogous to Chalk

This introduces a bunch of new binders in lots of places, which we have
to be careful about, but we had to add them at some point.
This commit is contained in:
Florian Diebold 2021-03-21 13:22:22 +01:00
parent 35868c4f7d
commit 590c416359
8 changed files with 213 additions and 105 deletions

View file

@ -236,7 +236,11 @@ 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| b.subst(&substs)).collect::<Vec<_>>();
let predicates = bounds
.iter()
.cloned()
.map(|b| hir_ty::Binders::new(0, b.subst(&substs)))
.collect::<Vec<_>>();
if !(predicates.is_empty() || f.omit_verbose_types()) {
write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?;
}