rust/tests/mir-opt/unreachable_diverging.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
363 B
Rust
Raw Normal View History

// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
pub enum Empty {}
fn empty() -> Option<Empty> {
None
}
fn loop_forever() {
loop {}
}
2020-07-27 14:22:43 -05:00
// EMIT_MIR unreachable_diverging.main.UnreachablePropagation.diff
fn main() {
let x = true;
if let Some(bomb) = empty() {
if x {
loop_forever()
}
match bomb {}
}
}