From 47eef0ea3381e1db49174400ef423b64e149deb8 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 2 Apr 2025 23:35:24 +0000 Subject: [PATCH] Account for TypeFlags in OpportunisticRegionResolver --- compiler/rustc_infer/src/infer/resolve.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/rustc_infer/src/infer/resolve.rs b/compiler/rustc_infer/src/infer/resolve.rs index 4a99c2209755d..e414f89bfe4e5 100644 --- a/compiler/rustc_infer/src/infer/resolve.rs +++ b/compiler/rustc_infer/src/infer/resolve.rs @@ -107,6 +107,10 @@ impl<'a, 'tcx> TypeFolder> for OpportunisticRegionResolver<'a, 'tcx ct.super_fold_with(self) } } + + fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> { + if !p.has_infer_regions() { p } else { p.super_fold_with(self) } + } } ///////////////////////////////////////////////////////////////////////////