about summary refs log tree commit diff
path: root/compiler/rustc_next_trait_solver/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-06-05 16:36:47 +0000
committerMichael Goulet <michael@errs.io>2025-06-06 15:34:14 +0000
commit8addb6f3be3cd166bf40919c766cde2efc19fbaa (patch)
treef1c6c5029e4dd3191ee26ea17a1d9c471b25550d /compiler/rustc_next_trait_solver/src
parentf315e6145802e091ff9fceab6db627a4b4ec2b86 (diff)
downloadrust-8addb6f3be3cd166bf40919c766cde2efc19fbaa.tar.gz
rust-8addb6f3be3cd166bf40919c766cde2efc19fbaa.zip
Filter out universals and lifetimes from stalled_vars
Diffstat (limited to 'compiler/rustc_next_trait_solver/src')
-rw-r--r--compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
index 38d7ff576a5..345ece20b7e 100644
--- a/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
+++ b/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
@@ -544,8 +544,19 @@ where
                 // to recompute this goal.
                 HasChanged::Yes => None,
                 HasChanged::No => {
-                    // Remove the unconstrained RHS arg, which is expected to have changed.
                     let mut stalled_vars = orig_values;
+
+                    // Remove the canonicalized universal vars, since we only care about stalled existentials.
+                    stalled_vars.retain(|arg| match arg.kind() {
+                        ty::GenericArgKind::Type(ty) => matches!(ty.kind(), ty::Infer(_)),
+                        ty::GenericArgKind::Const(ct) => {
+                            matches!(ct.kind(), ty::ConstKind::Infer(_))
+                        }
+                        // Lifetimes can never stall goals.
+                        ty::GenericArgKind::Lifetime(_) => false,
+                    });
+
+                    // Remove the unconstrained RHS arg, which is expected to have changed.
                     if let Some(normalizes_to) = goal.predicate.as_normalizes_to() {
                         let normalizes_to = normalizes_to.skip_binder();
                         let rhs_arg: I::GenericArg = normalizes_to.term.into();