Add an early-exit to QueryNormalizer::fold_ty

This commit is contained in:
Jonas Schievink 2020-01-28 00:52:21 +01:00
parent b181835a6b
commit 474d0e3371

View File

@ -81,6 +81,10 @@ fn tcx<'c>(&'c self) -> TyCtxt<'tcx> {
}
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
if !ty.has_projections() {
return ty;
}
let ty = ty.super_fold_with(self);
match ty.kind {
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {