Rollup merge of #114542 - RalfJung:const-prop-nonsense, r=compiler-errors
interpret: use ConstPropNonsense for more const-prop induced issues
This commit is contained in:
@@ -269,7 +269,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
let ty = self.subst_from_current_frame_and_normalize_erasing_regions(ty)?;
|
||||
let layout = self.layout_of(ty)?;
|
||||
if let mir::NullOp::SizeOf | mir::NullOp::AlignOf = null_op && layout.is_unsized() {
|
||||
// FIXME: This should be a span_bug (#80742)
|
||||
// FIXME: This should be a span_bug, but const generics can run MIR
|
||||
// that is not properly type-checked yet (#97477).
|
||||
self.tcx.sess.delay_span_bug(
|
||||
self.frame().current_span(),
|
||||
format!("{null_op:?} MIR operator called for unsized type {ty}"),
|
||||
|
||||
Reference in New Issue
Block a user