Skip to content

Commit

Permalink
Add an early-exit to QueryNormalizer::fold_ty
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Jan 28, 2020
1 parent b181835 commit 474d0e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc/traits/query/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for QueryNormalizer<'cx, '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() => {
Expand Down

0 comments on commit 474d0e3

Please sign in to comment.