about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-03-08 19:05:18 +0100
committerRalf Jung <post@ralfj.de>2020-03-08 19:05:18 +0100
commit48975946565e9a0adedb39a308db2fd2eeaa2839 (patch)
treebb6cc7e30991d66e8830583f645a1edb211c706e
parentf943349eafaa75a60c05b0c84dcdb771d0eae8c9 (diff)
miri: ICE on invalid terminators
-rw-r--r--src/librustc_mir/interpret/terminator.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/librustc_mir/interpret/terminator.rs b/src/librustc_mir/interpret/terminator.rs
index ea8378574a3..85fd502c69c 100644
--- a/src/librustc_mir/interpret/terminator.rs
+++ b/src/librustc_mir/interpret/terminator.rs
@@ -114,15 +114,12 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             Unreachable => throw_ub!(Unreachable),
 
             // These should never occur for MIR we actually run.
-            DropAndReplace { .. } | FalseEdges { .. } | FalseUnwind { .. } => {
-                bug!("{:#?} should have been eliminated by MIR pass", terminator.kind)
-            }
-
-            // These are not (yet) supported. It is unclear if they even can occur in
-            // MIR that we actually run.
-            Yield { .. } | GeneratorDrop | Abort => {
-                throw_unsup_format!("Unsupported terminator kind: {:#?}", terminator.kind)
-            }
+            DropAndReplace { .. }
+            | FalseEdges { .. }
+            | FalseUnwind { .. }
+            | Yield { .. }
+            | GeneratorDrop
+            | Abort => bug!("{:#?} should have been eliminated by MIR pass", terminator.kind),
         }
 
         Ok(())