Skip to content

Commit cab341f

Browse files
committed
Comment on a few odd things that we should look at
1 parent 0b52710 commit cab341f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
770770
// FIXME(oli-obk): make this check an assertion that it's not a static here
771771
// FIXME(RalfJ, oli-obk): document that `Place::Static` can never be anything but a static
772772
// and `ConstValue::Unevaluated` can never be a static
773+
// FIXME(oli-obk, spastorino): the above FIXME is not true anymore, PlaceBase::Static does
774+
// not exist anymore (except for promoteds but it's going away soon).
773775
let param_env = if self.tcx.is_static(gid.instance.def_id()) {
774776
ty::ParamEnv::reveal_all()
775777
} else {

src/librustc_mir/interpret/operand.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,8 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
584584
throw_inval!(TooGeneric),
585585
ty::ConstKind::Unevaluated(def_id, substs) => {
586586
let instance = self.resolve(def_id, substs)?;
587+
// FIXME: don't use `const_eval_raw` for regular constants, instead use `const_eval`
588+
// which immediately validates the result before we continue with it here.
587589
return Ok(OpTy::from(self.const_eval_raw(GlobalId {
588590
instance,
589591
promoted: None,

0 commit comments

Comments
 (0)