rust/tests/mir-opt/unreachable_diverging.rs
2023-01-11 09:32:08 +00:00

21 lines
309 B
Rust

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 {}
}
}