diff options
| author | Ralf Jung <post@ralfj.de> | 2023-08-08 10:31:44 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-08-08 10:35:22 +0200 |
| commit | a7132bf3873d63d3534c28dc7be85c5b363395f6 (patch) | |
| tree | 42ebaab004bc79292159e39eac6c8690d6b86772 /compiler/rustc_const_eval/src | |
| parent | 6742e2b18502afa9d27b0e02d0cfa36aa93aa2ee (diff) | |
| download | rust-a7132bf3873d63d3534c28dc7be85c5b363395f6.tar.gz rust-a7132bf3873d63d3534c28dc7be85c5b363395f6.zip | |
interpret: remove incomplete protection against invalid where clauses
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/errors.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/step.rs | 7 |
2 files changed, 2 insertions, 9 deletions
diff --git a/compiler/rustc_const_eval/src/errors.rs b/compiler/rustc_const_eval/src/errors.rs index 3a4e2648b80..4362cae7ed7 100644 --- a/compiler/rustc_const_eval/src/errors.rs +++ b/compiler/rustc_const_eval/src/errors.rs @@ -862,7 +862,6 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> { InvalidProgramInfo::FnAbiAdjustForForeignAbi(_) => { rustc_middle::error::middle_adjust_for_foreign_abi_error } - InvalidProgramInfo::SizeOfUnsizedType(_) => const_eval_size_of_unsized, InvalidProgramInfo::ConstPropNonsense => { panic!("We had const-prop nonsense, this should never be printed") } @@ -890,9 +889,6 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> { builder.set_arg("arch", arch); builder.set_arg("abi", abi.name()); } - InvalidProgramInfo::SizeOfUnsizedType(ty) => { - builder.set_arg("ty", ty); - } } } } 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(), |
