Skip to content

Commit a59abfa

Browse files
spastorinooli-obk
authored andcommitted
Revert const_eval call to use const_eval_raw to avoid const validation cycles
1 parent 2d8d559 commit a59abfa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_mir/interpret/operand.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,12 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
542542
// happening.
543543
// FIXME(oli-obk): eliminate all the `const_eval_raw` usages when we get rid of
544544
// `StaticKind` once and for all.
545-
return self.const_eval(GlobalId { instance, promoted: None });
545+
// FIXME the following line should have been:
546+
// return self.const_eval(GlobalId { instance, promoted });
547+
// but since the addition of Promoteds being Constants is causing const validation
548+
// cycles. Promoteds being Constants exercise const validation more often and it
549+
// may have made show up a pre-existing bug.
550+
return Ok(OpTy::from(self.const_eval_raw(GlobalId { instance, promoted })?));
546551
}
547552
ty::ConstKind::Infer(..)
548553
| ty::ConstKind::Bound(..)

0 commit comments

Comments
 (0)