summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-08 21:44:45 +0200
committerGitHub <noreply@github.com>2023-08-08 21:44:45 +0200
commit5c5ae6c5f399413113ab2f39e71f5ce3f57d1865 (patch)
tree88c35f00be7e037efd9d020a026a076515d524e9 /compiler/rustc_const_eval/src/interpret
parent4f82fb81f53464729ed836c5f06a0fe048d5c777 (diff)
parenta7132bf3873d63d3534c28dc7be85c5b363395f6 (diff)
downloadrust-5c5ae6c5f399413113ab2f39e71f5ce3f57d1865.tar.gz
rust-5c5ae6c5f399413113ab2f39e71f5ce3f57d1865.zip
Rollup merge of #114615 - RalfJung:interpret-invalid-where, r=lcnr
interpret: remove incomplete protection against invalid where clauses

Cc https://github.com/rust-lang/rust/issues/97477, https://github.com/rust-lang/project-const-generics/issues/37

r? ``@lcnr``
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index f04c73105d2..0740894a4ff 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -269,13 +269,10 @@ 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, but const generics can run MIR
-                    // that is not properly type-checked yet (#97477).
-                    self.tcx.sess.delay_span_bug(
+                    span_bug!(
                         self.frame().current_span(),
-                        format!("{null_op:?} MIR operator called for unsized type {ty}"),
+                        "{null_op:?} MIR operator called for unsized type {ty}",
                     );
-                    throw_inval!(SizeOfUnsizedType(ty));
                 }
                 let val = match null_op {
                     mir::NullOp::SizeOf => layout.size.bytes(),