about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/option_bubble_debug.option_traits.PreCodegen.after.panic-unwind.mir
blob: bda9e9d8e6045b8c9a28ac99505043d525062cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// MIR for `option_traits` after PreCodegen

fn option_traits(_1: Option<u32>) -> Option<u32> {
    debug x => _1;
    let mut _0: std::option::Option<u32>;
    let mut _2: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
    let mut _3: isize;
    let _4: u32;
    let mut _5: u32;
    scope 1 {
        debug residual => const Option::<Infallible>::None;
        scope 2 {
        }
    }
    scope 3 {
        debug val => _4;
        scope 4 {
        }
    }

    bb0: {
        _2 = <Option<u32> as Try>::branch(copy _1) -> [return: bb1, unwind continue];
    }

    bb1: {
        _3 = discriminant(_2);
        switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb5];
    }

    bb2: {
        _4 = copy ((_2 as Continue).0: u32);
        _5 = Not(copy _4);
        _0 = <Option<u32> as Try>::from_output(move _5) -> [return: bb4, unwind continue];
    }

    bb3: {
        _0 = <Option<u32> as FromResidual<Option<Infallible>>>::from_residual(const Option::<Infallible>::None) -> [return: bb4, unwind continue];
    }

    bb4: {
        return;
    }

    bb5: {
        unreachable;
    }
}