clean up some const error reporting around promoteds
This commit is contained in:
parent
ea73caa3b7
commit
d6eb4f571e
@ -134,11 +134,9 @@ pub(crate) fn codegen_constant<'tcx>(
|
||||
{
|
||||
Ok(const_val) => const_val,
|
||||
Err(_) => {
|
||||
if promoted.is_none() {
|
||||
fx.tcx
|
||||
.sess
|
||||
.span_err(constant.span, "erroneous constant encountered");
|
||||
}
|
||||
fx.tcx
|
||||
.sess
|
||||
.span_err(constant.span, "erroneous constant encountered");
|
||||
return crate::trap::trap_unreachable_ret_value(
|
||||
fx,
|
||||
fx.layout_of(const_.ty),
|
||||
|
Loading…
Reference in New Issue
Block a user