Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit aafd75a

Browse files
committedJul 28, 2023
Auto merge of #114134 - fee1-dead-contrib:rm-constness-from-param-env, r=oli-obk
Remove `constness` from `ParamEnv` This should be replaced by keyword generics/effects. cc #110395 r? `@oli-obk`
2 parents 37343f4 + b0fa220 commit aafd75a

File tree

102 files changed

+419
-1057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+419
-1057
lines changed
 

‎compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,18 +409,12 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
409409
}
410410

411411
if let ty::FnDef(def_id, args) = *constant.literal.ty().kind() {
412-
// const_trait_impl: use a non-const param env when checking that a FnDef type is well formed.
413-
// this is because the well-formedness of the function does not need to be proved to have `const`
414-
// impls for trait bounds.
415412
let instantiated_predicates = tcx.predicates_of(def_id).instantiate(tcx, args);
416-
let prev = self.cx.param_env;
417-
self.cx.param_env = prev.without_const();
418413
self.cx.normalize_and_prove_instantiated_predicates(
419414
def_id,
420415
instantiated_predicates,
421416
locations,
422417
);
423-
self.cx.param_env = prev;
424418
}
425419
}
426420
}

‎compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
228228
tcx: TyCtxt<'tcx>,
229229
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
230230
) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> {
231-
assert!(key.param_env.is_const());
232231
// see comment in eval_to_allocation_raw_provider for what we're doing here
233232
if key.param_env.reveal() == Reveal::All {
234233
let mut key = key;
@@ -269,7 +268,6 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
269268
tcx: TyCtxt<'tcx>,
270269
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
271270
) -> ::rustc_middle::mir::interpret::EvalToAllocationRawResult<'tcx> {
272-
assert!(key.param_env.is_const());
273271
// Because the constant is computed twice (once per value of `Reveal`), we are at risk of
274272
// reporting the same error twice here. To resolve this, we check whether we can evaluate the
275273
// constant in the more restrictive `Reveal::UserFacing`, which most likely already was

0 commit comments

Comments
 (0)
Please sign in to comment.