Skip to content

Commit 6bd6498

Browse files
committed
Reduce might be redundant normalizes-to nested goal evaluations
1 parent b710176 commit 6bd6498

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • compiler/rustc_next_trait_solver/src/solve/project_goals

compiler/rustc_next_trait_solver/src/solve/project_goals/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ where
3434
GoalEvaluation { goal: _, certainty, stalled_on: _, has_changed: _ },
3535
) = self.evaluate_goal_raw(GoalSource::TypeRelating, normalizes_to, None)?;
3636

37-
// Add the nested goals from normalization to our own nested goals.
3837
trace!(?nested_goals);
39-
for (s, g) in nested_goals {
40-
self.add_goal(s, g);
41-
}
4238

4339
// Normalize alias types in rhs. This is done in `EvalCtxt::add_goal` for nested
4440
// goals, but we might be evaluating the root goal.
@@ -70,6 +66,11 @@ where
7066
// consider changing this to only use "shallow structural equality".
7167
self.eq_structurally_relating_aliases(goal.param_env, term, unconstrained_term)?;
7268

69+
// Add the nested goals from normalization to our own nested goals.
70+
for (s, g) in nested_goals {
71+
self.add_goal(s, g);
72+
}
73+
7374
self.evaluate_added_goals_and_make_canonical_response(certainty)
7475
}
7576

0 commit comments

Comments
 (0)