From a59abfa450cf9d18d725c2b757686fd4b65ccbe5 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 31 Dec 2019 11:47:33 -0300 Subject: [PATCH] Revert const_eval call to use const_eval_raw to avoid const validation cycles --- src/librustc_mir/interpret/operand.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/operand.rs b/src/librustc_mir/interpret/operand.rs index ddd9776e893..94a774d646a 100644 --- a/src/librustc_mir/interpret/operand.rs +++ b/src/librustc_mir/interpret/operand.rs @@ -542,7 +542,12 @@ pub(super) fn eval_operands( // 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(..) -- 2.44.0