Skip to content

Commit 3761dcd

Browse files
committed
Auto merge of #68606 - jonas-schievink:normalize-fastpath, r=Zoxc
Add an early-exit to `QueryNormalizer::fold_ty` Pulled out from #68524, this results in a ~60-70% reduction in compile time for the await-call-tree benchmarks. This should unblock #67982 as well. r? @Zoxc
2 parents ac2f3fa + 474d0e3 commit 3761dcd

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)