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 ff2439b

Browse files
committedDec 3, 2021
Auto merge of #91491 - spastorino:revert-91354, r=oli-obk
Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino" This reverts commit 18bb8c6, reversing changes made to d9baa36. Reverts #91354 in order to address #91489. We would need to place this changes in a more granular way and would also be nice to address the small perf regression that was also introduced. r? `@oli-obk` cc `@fee1-dead`
2 parents 2a9e083 + 85b723c commit ff2439b

File tree

49 files changed

+428
-376
lines changed

Some content is hidden

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

49 files changed

+428
-376
lines changed
 

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rustc_middle::ty::fold::TypeFoldable;
3131
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef, UserSubsts};
3232
use rustc_middle::ty::{
3333
self, CanonicalUserTypeAnnotation, CanonicalUserTypeAnnotations, OpaqueTypeKey, RegionVid,
34-
ToPredicate, Ty, TyCtxt, UserType, UserTypeAnnotationIndex,
34+
ToPredicate, Ty, TyCtxt, UserType, UserTypeAnnotationIndex, WithConstness,
3535
};
3636
use rustc_span::def_id::CRATE_DEF_ID;
3737
use rustc_span::{Span, DUMMY_SP};

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::interpret::{
77
};
88

99
use rustc_errors::ErrorReported;
10-
use rustc_hir as hir;
1110
use rustc_hir::def::DefKind;
1211
use rustc_middle::mir;
1312
use rustc_middle::mir::interpret::ErrorHandled;
@@ -216,7 +215,6 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
216215
tcx: TyCtxt<'tcx>,
217216
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
218217
) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> {
219-
assert!(key.param_env.constness() == hir::Constness::Const);
220218
// see comment in eval_to_allocation_raw_provider for what we're doing here
221219
if key.param_env.reveal() == Reveal::All {
222220
let mut key = key;
@@ -251,7 +249,6 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
251249
tcx: TyCtxt<'tcx>,
252250
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
253251
) -> ::rustc_middle::mir::interpret::EvalToAllocationRawResult<'tcx> {
254-
assert!(key.param_env.constness() == hir::Constness::Const);
255252
// Because the constant is computed twice (once per value of `Reveal`), we are at risk of
256253
// reporting the same error twice here. To resolve this, we check whether we can evaluate the
257254
// constant in the more restrictive `Reveal::UserFacing`, which most likely already was

0 commit comments

Comments
 (0)
Please sign in to comment.