From 5c6deaf32fe5f0077df4edc1a8da12d4a58ad0c9 Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Wed, 8 Feb 2023 14:05:10 +0100 Subject: [PATCH] delete no-op caching optimization from (old) trait solver --- .../rustc_trait_selection/src/traits/select/mod.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 0c6b2406bbdaf..cdb70c4a7a4b9 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1002,17 +1002,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { previous_stack: TraitObligationStackList<'o, 'tcx>, mut obligation: TraitObligation<'tcx>, ) -> Result { - 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;