about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits/auto_trait.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-05-22 18:55:49 +0000
committerMichael Goulet <michael@errs.io>2025-05-26 08:28:45 +0000
commit3efd885927958ec8af33fbd1fa2da3d62bbae108 (patch)
tree37f75c5f6f7fc4c919c6a4faf5db1926c8e4d9f9 /compiler/rustc_trait_selection/src/traits/auto_trait.rs
parent95a2212587f1b8500af1ac630322b0cb2e030c61 (diff)
downloadrust-3efd885927958ec8af33fbd1fa2da3d62bbae108.tar.gz
rust-3efd885927958ec8af33fbd1fa2da3d62bbae108.zip
Avoid obligation construction dance with query region constraints
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/auto_trait.rs')
-rw-r--r--compiler/rustc_trait_selection/src/traits/auto_trait.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
index 02521c9453d..620c1591737 100644
--- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs
+++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs
@@ -726,7 +726,9 @@ impl<'tcx> AutoTraitFinder<'tcx> {
                 }
                 ty::PredicateKind::Clause(ty::ClauseKind::RegionOutlives(binder)) => {
                     let binder = bound_predicate.rebind(binder);
-                    selcx.infcx.region_outlives_predicate(&dummy_cause, binder)
+                    selcx.infcx.enter_forall(binder, |pred| {
+                        selcx.infcx.region_outlives_predicate(pred, &dummy_cause);
+                    });
                 }
                 ty::PredicateKind::Clause(ty::ClauseKind::TypeOutlives(binder)) => {
                     let binder = bound_predicate.rebind(binder);
@@ -735,14 +737,14 @@ impl<'tcx> AutoTraitFinder<'tcx> {
                         binder.map_bound_ref(|pred| pred.0).no_bound_vars(),
                     ) {
                         (None, Some(t_a)) => {
-                            selcx.infcx.register_region_obligation_with_cause(
+                            selcx.infcx.type_outlives_predicate_with_cause(
                                 t_a,
                                 selcx.infcx.tcx.lifetimes.re_static,
                                 &dummy_cause,
                             );
                         }
                         (Some(ty::OutlivesPredicate(t_a, r_b)), _) => {
-                            selcx.infcx.register_region_obligation_with_cause(
+                            selcx.infcx.type_outlives_predicate_with_cause(
                                 t_a,
                                 r_b,
                                 &dummy_cause,