Skip to content

Commit

Permalink
Remove another instance of the param-env hack
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Nov 17, 2023
1 parent 7040f84 commit 4afc540
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 @@ -1031,17 +1031,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
previous_stack: TraitObligationStackList<'o, 'tcx>,
mut obligation: PolyTraitObligation<'tcx>,
) -> Result<EvaluationResult, OverflowError> {
if !self.is_intercrate()
&& obligation.is_global()
&& obligation.param_env.caller_bounds().iter().all(|bound| bound.has_param())
{
// 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 fresh_trait_pred = stack.fresh_trait_pred;
let param_env = obligation.param_env;
Expand Down

0 comments on commit 4afc540

Please sign in to comment.