about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_mir_build/src/thir/cx/mod.rs4
1 files 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"),
         }