rust/tests/mir-opt/unreachable.rs
2023-10-19 15:51:52 +00:00

23 lines
350 B
Rust

// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
enum Empty {}
fn empty() -> Option<Empty> {
None
}
// EMIT_MIR unreachable.main.UnreachablePropagation.diff
fn main() {
if let Some(_x) = empty() {
let mut _y;
if true {
_y = 21;
} else {
_y = 42;
}
match _x { }
}
}