diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index eb70a35d3708c..bb4275fbcef67 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -991,12 +991,6 @@ impl<'tcx> ParamEnv<'tcx> { ParamEnv { caller_bounds } } - /// Returns this same environment but with no caller bounds. - #[inline] - pub fn without_caller_bounds(self) -> Self { - Self::new(ListWithCachedTypeInfo::empty()) - } - /// Creates a pair of param-env and value for use in queries. pub fn and>>(self, value: T) -> ParamEnvAnd<'tcx, T> { ParamEnvAnd { param_env: self, value } diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 436ce3dddd9f0..d5e7a9eba1393 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1008,7 +1008,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { // 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(); + obligation.param_env = ty::ParamEnv::empty(); } let stack = self.push_stack(previous_stack, &obligation);