summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/unreachable.rs
blob: 23fad4737fe9a03bc4f81d6250c698ecf90d6cf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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 { }
    }
}