diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-03-01 11:34:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-01 11:34:02 +0100 |
| commit | c03756a56b2e5a5e327f4e81b37ede0c92e8d305 (patch) | |
| tree | 0d49dd53673a4f98be3d4cbec4bfa1c1d99b356c | |
| parent | b6c1b635f7b59d3f3460e2a4c115704e49f3b682 (diff) | |
| parent | b3330f81824b2266de07c647df2c72245f90f5ad (diff) | |
Rollup merge of #137800 - BoxyUwU:param_env_docs, r=compiler-errors
Remove `ParamEnv::without_caller_bounds` This doesn't really do anything that `ParamEnv::empty` doesn't do nowadays as `ParamEnv` *only* stores caller bounds since other information has been moved out into `TypingMode` r? ```@compiler-errors``` ```@lcnr```
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 2 |
2 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index d926d6cc02a..527509af05f 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -992,12 +992,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<T: TypeVisitable<TyCtxt<'tcx>>>(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 120e6f6e2ce..77dbb43465e 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1007,7 +1007,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); |
