move UnsafeCell-in-const check from interning to validation
This commit is contained in:
@@ -9,7 +9,6 @@ use rustc_hir::def::DefKind;
|
||||
use rustc_hir::HirId;
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_middle::mir::interpret::{InterpResult, Scalar};
|
||||
use rustc_middle::mir::visit::{
|
||||
MutVisitor, MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor,
|
||||
};
|
||||
@@ -28,9 +27,10 @@ use rustc_trait_selection::traits;
|
||||
|
||||
use crate::const_eval::ConstEvalErr;
|
||||
use crate::interpret::{
|
||||
self, compile_time_machine, truncate, AllocId, Allocation, ConstValue, Frame, ImmTy, Immediate,
|
||||
InterpCx, LocalState, LocalValue, MemPlace, Memory, MemoryKind, OpTy, Operand as InterpOperand,
|
||||
PlaceTy, Pointer, ScalarMaybeUninit, StackPopCleanup,
|
||||
self, compile_time_machine, truncate, AllocId, Allocation, ConstValue, CtfeValidationMode,
|
||||
Frame, ImmTy, Immediate, InterpCx, InterpResult, LocalState, LocalValue, MemPlace, Memory,
|
||||
MemoryKind, OpTy, Operand as InterpOperand, PlaceTy, Pointer, Scalar, ScalarMaybeUninit,
|
||||
StackPopCleanup,
|
||||
};
|
||||
use crate::transform::MirPass;
|
||||
|
||||
@@ -805,8 +805,9 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
||||
value,
|
||||
vec![],
|
||||
// FIXME: is ref tracking too expensive?
|
||||
// FIXME: what is the point of ref tracking if we do not even check the tracked refs?
|
||||
&mut interpret::RefTracking::empty(),
|
||||
/*may_ref_to_static*/ true,
|
||||
CtfeValidationMode::Regular,
|
||||
) {
|
||||
trace!("validation error, attempt failed: {:?}", e);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user