From 26ba4c4c7129feaa5d5c3793c647720a7806e1b2 Mon Sep 17 00:00:00 2001 From: Adwin White Date: Thu, 9 Jul 2026 17:37:17 +0800 Subject: [PATCH] do not normalize projection goal in `add_goal` --- .../src/solve/eval_ctxt/mod.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 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 d83320f5fe800..a2fb8b2b5d45f 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 @@ -1037,11 +1037,17 @@ where source: GoalSource, mut goal: Goal, ) -> Result<(), NoSolutionOrRerunNonErased> { - goal.predicate = self.normalize( - GoalSource::NormalizeGoal(self.step_kind_for_source(source)), - goal.param_env, - ty::Unnormalized::new_wip(goal.predicate), - )?; + if let PredicateKind::Clause(ClauseKind::Projection(_)) = + goal.predicate.kind().skip_binder() + { + } else { + goal.predicate = self.normalize( + GoalSource::NormalizeGoal(self.step_kind_for_source(source)), + goal.param_env, + ty::Unnormalized::new_wip(goal.predicate), + )?; + } + self.inspect.add_goal(self.delegate, self.max_input_universe, source, goal); self.nested_goals.push((source, goal, None)); Ok(())