Skip to content

Commit

Permalink
clean up some const error reporting around promoteds
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jan 24, 2021
1 parent ea73caa commit d6eb4f5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d6eb4f5

Please sign in to comment.