rust/tests/mir-opt/unreachable_diverging.rs
2023-04-06 10:08:07 +01:00

22 lines
363 B
Rust

// ignore-wasm32 compiled with panic=abort by default
pub enum Empty {}
fn empty() -> Option<Empty> {
None
}
fn loop_forever() {
loop {}
}
// EMIT_MIR unreachable_diverging.main.UnreachablePropagation.diff
fn main() {
let x = true;
if let Some(bomb) = empty() {
if x {
loop_forever()
}
match bomb {}
}
}