Skip to content

Commit

Permalink
Revert const_eval call to use const_eval_raw to avoid const validatio…
Browse files Browse the repository at this point in the history
…n cycles
  • Loading branch information
spastorino authored and oli-obk committed Jan 10, 2020
1 parent 2d8d559 commit a59abfa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_mir/interpret/operand.rs
Expand Up @@ -542,7 +542,12 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
// happening.
// FIXME(oli-obk): eliminate all the `const_eval_raw` usages when we get rid of
// `StaticKind` once and for all.
return self.const_eval(GlobalId { instance, promoted: None });
// FIXME the following line should have been:
// return self.const_eval(GlobalId { instance, promoted });
// but since the addition of Promoteds being Constants is causing const validation
// cycles. Promoteds being Constants exercise const validation more often and it
// may have made show up a pre-existing bug.
return Ok(OpTy::from(self.const_eval_raw(GlobalId { instance, promoted })?));
}
ty::ConstKind::Infer(..)
| ty::ConstKind::Bound(..)
Expand Down

0 comments on commit a59abfa

Please sign in to comment.