1
Fork 0

clean up some const error reporting around promoteds

This commit is contained in:
Ralf Jung 2021-01-24 12:50:30 +01:00
parent 4d0dd02ee0
commit 48f9dbfd59
18 changed files with 66 additions and 144 deletions

View file

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