Skip to content

Commit d6eb4f5

Browse files
committed
clean up some const error reporting around promoteds
1 parent ea73caa commit d6eb4f5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/constant.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,9 @@ pub(crate) fn codegen_constant<'tcx>(
134134
{
135135
Ok(const_val) => const_val,
136136
Err(_) => {
137-
if promoted.is_none() {
138-
fx.tcx
139-
.sess
140-
.span_err(constant.span, "erroneous constant encountered");
141-
}
137+
fx.tcx
138+
.sess
139+
.span_err(constant.span, "erroneous constant encountered");
142140
return crate::trap::trap_unreachable_ret_value(
143141
fx,
144142
fx.layout_of(const_.ty),

0 commit comments

Comments
 (0)