Skip to content

Commit

Permalink
Unrolled build for rust-lang#137800
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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```
  • Loading branch information
rust-timer authored Mar 1, 2025
2 parents 0c72c0d + b3330f8 commit 30bfe53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 30bfe53

Please sign in to comment.