Skip to content

Commit

Permalink
delete no-op caching optimization from (old) trait solver
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Markeffsky committed Feb 8, 2023
1 parent 6eb9f2d commit 5c6deaf
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,17 +1002,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
previous_stack: TraitObligationStackList<'o, 'tcx>,
mut obligation: TraitObligation<'tcx>,
) -> Result<EvaluationResult, OverflowError> {
if !self.is_intercrate()
&& obligation.is_global()
&& obligation.param_env.caller_bounds().iter().all(|bound| bound.needs_subst())
{
// If a param env has no global bounds, global obligations do not
// depend on its particular value in order to work, so we can clear
// out the param env and get better caching.
debug!("in global");
obligation.param_env = obligation.param_env.without_caller_bounds();
}

let stack = self.push_stack(previous_stack, &obligation);
let mut fresh_trait_pred = stack.fresh_trait_pred;
let mut param_env = obligation.param_env;
Expand Down

0 comments on commit 5c6deaf

Please sign in to comment.