Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3ab1cc6

Browse files
committed
Auto merge of rust-lang#139288 - compiler-errors:folder-experiment-2, r=<try>
Folder experiment: Account for TypeFlags in OpportunisticRegionResolver **NOTE:** This is one of a series of perf experiments that I've come up with while sick in bed. I'm assigning them to lqd b/c you're a good reviewer and you'll hopefully be awake when these experiments finish, lol. r? lqd The `OpportunisticRegionResolver` is hot, so let's avoid unnecessarily folding predicates. This will likey end up being a noop, so close this if it's perf neutral.
2 parents d5b4c2e + 47eef0e commit 3ab1cc6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_infer/src/infer/resolve.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for OpportunisticRegionResolver<'a, 'tcx
107107
ct.super_fold_with(self)
108108
}
109109
}
110+
111+
fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> {
112+
if !p.has_infer_regions() { p } else { p.super_fold_with(self) }
113+
}
110114
}
111115

112116
///////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)