Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"
This reverts commit18bb8c61a9
, reversing changes made tod9baa36190
.
This commit is contained in:
parent
3e21768a0a
commit
85b723c4e6
49 changed files with 428 additions and 376 deletions
|
@ -7,7 +7,6 @@ use crate::interpret::{
|
|||
};
|
||||
|
||||
use rustc_errors::ErrorReported;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::mir::interpret::ErrorHandled;
|
||||
|
@ -216,7 +215,6 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
|
|||
tcx: TyCtxt<'tcx>,
|
||||
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
|
||||
) -> ::rustc_middle::mir::interpret::EvalToConstValueResult<'tcx> {
|
||||
assert!(key.param_env.constness() == hir::Constness::Const);
|
||||
// see comment in eval_to_allocation_raw_provider for what we're doing here
|
||||
if key.param_env.reveal() == Reveal::All {
|
||||
let mut key = key;
|
||||
|
@ -251,7 +249,6 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
|
|||
tcx: TyCtxt<'tcx>,
|
||||
key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>,
|
||||
) -> ::rustc_middle::mir::interpret::EvalToAllocationRawResult<'tcx> {
|
||||
assert!(key.param_env.constness() == hir::Constness::Const);
|
||||
// Because the constant is computed twice (once per value of `Reveal`), we are at risk of
|
||||
// reporting the same error twice here. To resolve this, we check whether we can evaluate the
|
||||
// constant in the more restrictive `Reveal::UserFacing`, which most likely already was
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue