Use the explicit error constant instead of fake dummies

This commit is contained in:
Oli Scherer 2021-03-08 14:09:22 +00:00
parent 0bb367e070
commit d5eec653c0
1 changed files with 2 additions and 2 deletions

View File

@ -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"),
}