Try out a perf optimization

This commit is contained in:
Oli Scherer 2022-07-15 15:26:46 +00:00
parent 20d962cfa5
commit 36cb01deb3

View File

@ -373,6 +373,11 @@ where
substs: SubstsRef<'tcx>,
filter: impl Fn(Ty<'tcx>) -> (DefId, SubstsRef<'tcx>),
) {
// An optimization for a common case with opaque types.
if substs.is_empty() {
return;
}
// This case is thorny for inference. The fundamental problem is
// that there are many cases where we have choice, and inference
// doesn't like choice (the current region inference in