don't normalize wf predicates

this allows us to soundly use unnormalized projections for wf
This commit is contained in:
lcnr 2022-07-13 19:42:08 +02:00
parent 8d1fa7105b
commit f25cb83296
26 changed files with 226 additions and 102 deletions

View file

@ -619,6 +619,15 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
constant.eval(self.selcx.tcx(), self.param_env)
}
}
#[inline]
fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> {
if p.allow_normalization() && needs_normalization(&p, self.param_env.reveal()) {
p.super_fold_with(self)
} else {
p
}
}
}
pub struct BoundVarReplacer<'me, 'tcx> {