summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building/enum_cast.droppy.built.after.mir
blob: ea0edb610f5cce97c3acde9e1d8a1f2aa83bc1c9 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// MIR for `droppy` after built

fn droppy() -> () {
    let mut _0: ();
    let _1: ();
    let _2: Droppy;
    let _4: Droppy;
    let mut _5: isize;
    let mut _6: u8;
    let mut _7: bool;
    let _8: Droppy;
    scope 1 {
        debug x => _2;
        scope 2 {
            debug y => _3;
        }
        scope 3 {
            let _3: usize;
        }
    }
    scope 4 {
        debug z => _8;
    }

    bb0: {
        StorageLive(_1);
        StorageLive(_2);
        _2 = Droppy::C;
        FakeRead(ForLet(None), _2);
        StorageLive(_3);
        StorageLive(_4);
        _4 = move _2;
        _5 = discriminant(_4);
        _6 = _5 as u8 (IntToInt);
        _7 = Le(_6, const 2_u8);
        assume(move _7);
        _3 = move _5 as usize (IntToInt);
        drop(_4) -> [return: bb1, unwind: bb4];
    }

    bb1: {
        StorageDead(_4);
        FakeRead(ForLet(None), _3);
        _1 = const ();
        StorageDead(_3);
        drop(_2) -> [return: bb2, unwind: bb5];
    }

    bb2: {
        StorageDead(_2);
        StorageDead(_1);
        StorageLive(_8);
        _8 = Droppy::B;
        FakeRead(ForLet(None), _8);
        _0 = const ();
        drop(_8) -> [return: bb3, unwind: bb5];
    }

    bb3: {
        StorageDead(_8);
        return;
    }

    bb4 (cleanup): {
        drop(_2) -> [return: bb5, unwind terminate(cleanup)];
    }

    bb5 (cleanup): {
        resume;
    }
}