Skip to content

Commit 4897594

Browse files
committed
miri: ICE on invalid terminators
1 parent f943349 commit 4897594

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/librustc_mir/interpret/terminator.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,12 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
114114
Unreachable => throw_ub!(Unreachable),
115115

116116
// These should never occur for MIR we actually run.
117-
DropAndReplace { .. } | FalseEdges { .. } | FalseUnwind { .. } => {
118-
bug!("{:#?} should have been eliminated by MIR pass", terminator.kind)
119-
}
120-
121-
// These are not (yet) supported. It is unclear if they even can occur in
122-
// MIR that we actually run.
123-
Yield { .. } | GeneratorDrop | Abort => {
124-
throw_unsup_format!("Unsupported terminator kind: {:#?}", terminator.kind)
125-
}
117+
DropAndReplace { .. }
118+
| FalseEdges { .. }
119+
| FalseUnwind { .. }
120+
| Yield { .. }
121+
| GeneratorDrop
122+
| Abort => bug!("{:#?} should have been eliminated by MIR pass", terminator.kind),
126123
}
127124

128125
Ok(())

0 commit comments

Comments
 (0)