From d5eec653c0d0b445efa0aaf186e47baa24994f62 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Mon, 8 Mar 2021 14:09:22 +0000 Subject: [PATCH] Use the explicit error constant instead of fake dummies --- compiler/rustc_mir_build/src/thir/cx/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir_build/src/thir/cx/mod.rs b/compiler/rustc_mir_build/src/thir/cx/mod.rs index fe8a58c0088..c0433604f8c 100644 --- a/compiler/rustc_mir_build/src/thir/cx/mod.rs +++ b/compiler/rustc_mir_build/src/thir/cx/mod.rs @@ -68,11 +68,11 @@ impl<'thir, 'tcx> Cx<'thir, 'tcx> { // FIXME(#31407) this is only necessary because float parsing is buggy self.tcx.sess.span_err(sp, "could not evaluate float literal (see issue #31407)"); // create a dummy value and continue compiling - Const::from_bits(self.tcx, 0, self.param_env.and(ty)) + self.tcx.const_error(ty) } Err(LitToConstError::Reported) => { // create a dummy value and continue compiling - Const::from_bits(self.tcx, 0, self.param_env.and(ty)) + self.tcx.const_error(ty) } Err(LitToConstError::TypeError) => bug!("const_eval_literal: had type error"), }