Skip to content

Commit e67b72d

Browse files
authored
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
clean up some const error reporting around promoteds These are some error reporting simplifications enabled by rust-lang/rust#80579. Further simplifications are possible but could be blocked on making `const_err` a hard error. r? ``````@oli-obk``````
2 parents c3d7dc9 + d6eb4f5 commit e67b72d

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)