rust/tests/mir-opt/unreachable.rs

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

22 lines
350 B
Rust
Raw Normal View History

2023-04-05 08:44:20 +00:00
// ignore-wasm32 compiled with panic=abort by default
enum Empty {}
fn empty() -> Option<Empty> {
None
}
2020-07-27 19:22:43 +00:00
// 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 { }
}
}