diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-10-20 22:42:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-20 22:42:41 +0200 |
| commit | 801e32647e7ab8254aff9bcde537cf1011dcc12e (patch) | |
| tree | 3b893348715928d658b0545122a768747159e188 | |
| parent | 01111d44501e7c3ac7d938c3de93f8f46dfecda0 (diff) | |
| parent | bf14e3196b4f340b5c2a57b902b01e07a7d7c3dc (diff) | |
| download | rust-801e32647e7ab8254aff9bcde537cf1011dcc12e.tar.gz rust-801e32647e7ab8254aff9bcde537cf1011dcc12e.zip | |
Rollup merge of #103315 - RalfJung:interpret-switchint-ice, r=bjorn3
interpret: remove an incorrect assertion This fixes an ICE in Miri, [reported](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/SwitchInt.20with.20no.20targets.3F) by `@saethlin.` The faulty assertion was introduced by https://github.com/rust-lang/rust/commit/432535da2b5144d467056efcfa6864d35ba2de0f, when a previously correct assertion checking that the `otherwise` target exists got replaced by this assertion checking that at least one more target beyond `otherwise` exists. Sadly we don't have a small reproducer so I don't think we can easily add a testcase.
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/terminator.rs | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs index 50a82aa0e72..57e40e168fa 100644 --- a/compiler/rustc_const_eval/src/interpret/terminator.rs +++ b/compiler/rustc_const_eval/src/interpret/terminator.rs @@ -35,7 +35,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { assert_eq!(discr.layout.ty, switch_ty); // Branch to the `otherwise` case by default, if no match is found. - assert!(!targets.iter().is_empty()); let mut target_block = targets.otherwise(); for (const_int, target) in targets.iter() { |
