Skip to content

Commit 474d0e3

Browse files
Add an early-exit to QueryNormalizer::fold_ty
1 parent b181835 commit 474d0e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/traits/query/normalize.rs

+4
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
8181
}
8282

8383
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
84+
if !ty.has_projections() {
85+
return ty;
86+
}
87+
8488
let ty = ty.super_fold_with(self);
8589
match ty.kind {
8690
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {

0 commit comments

Comments
 (0)