summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/issue_62289.test.ElaborateDrops.before.mir
blob: 8ed9101500e4d1db6bfba9b59e1737dfd793104f (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// MIR for `test` before ElaborateDrops

fn test() -> Option<Box<u32>> {
    let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue_62289.rs:+0:14: +0:30
    let mut _1: std::boxed::Box<u32>;    // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
    let mut _2: usize;                   // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
    let mut _3: usize;                   // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
    let mut _4: *mut u8;                 // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
    let mut _5: std::boxed::Box<u32>;    // in scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
    let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
    let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/issue_62289.rs:+3:18: +3:22
    let mut _8: isize;                   // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
    let _9: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
    let mut _10: !;                      // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
    let mut _11: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
    let _12: u32;                        // in scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
    scope 1 {
    }
    scope 2 {
        debug residual => _9;            // in scope 2 at $DIR/issue_62289.rs:+3:22: +3:23
        scope 3 {
        }
    }
    scope 4 {
        debug val => _12;                // in scope 4 at $DIR/issue_62289.rs:+3:18: +3:23
        scope 5 {
        }
    }

    bb0: {
        StorageLive(_1);                 // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
        _2 = SizeOf(u32);                // scope 1 at $DIR/issue_62289.rs:+3:9: +3:24
        _3 = AlignOf(u32);               // scope 1 at $DIR/issue_62289.rs:+3:9: +3:24
        _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/issue_62289.rs:+3:9: +3:24
                                         // mir::Constant
                                         // + span: $DIR/issue_62289.rs:11:9: 11:24
                                         // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
    }

    bb1: {
        StorageLive(_5);                 // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
        _5 = ShallowInitBox(move _4, u32); // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
        StorageLive(_6);                 // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
        StorageLive(_7);                 // scope 0 at $DIR/issue_62289.rs:+3:18: +3:22
        _7 = Option::<u32>::None;        // scope 0 at $DIR/issue_62289.rs:+3:18: +3:22
        _6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12]; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
                                         // mir::Constant
                                         // + span: $DIR/issue_62289.rs:11:18: 11:23
                                         // + literal: Const { ty: fn(Option<u32>) -> ControlFlow<<Option<u32> as Try>::Residual, <Option<u32> as Try>::Output> {<Option<u32> as Try>::branch}, val: Value(<ZST>) }
    }

    bb2: {
        StorageDead(_7);                 // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
        _8 = discriminant(_6);           // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
        switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
    }

    bb3: {
        StorageLive(_12);                // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
        _12 = ((_6 as Continue).0: u32); // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
        (*_5) = _12;                     // scope 5 at $DIR/issue_62289.rs:+3:18: +3:23
        StorageDead(_12);                // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
        _1 = move _5;                    // scope 0 at $DIR/issue_62289.rs:+3:9: +3:24
        drop(_5) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
    }

    bb4: {
        unreachable;                     // scope 0 at $DIR/issue_62289.rs:+3:18: +3:23
    }

    bb5: {
        StorageLive(_9);                 // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
        _9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
        StorageLive(_11);                // scope 3 at $DIR/issue_62289.rs:+3:22: +3:23
        _11 = _9;                        // scope 3 at $DIR/issue_62289.rs:+3:22: +3:23
        _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; // scope 3 at $DIR/issue_62289.rs:+3:18: +3:23
                                         // mir::Constant
                                         // + span: $DIR/issue_62289.rs:11:22: 11:23
                                         // + literal: Const { ty: fn(Option<Infallible>) -> Option<Box<u32>> {<Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual}, val: Value(<ZST>) }
    }

    bb6: {
        StorageDead(_11);                // scope 3 at $DIR/issue_62289.rs:+3:22: +3:23
        StorageDead(_9);                 // scope 0 at $DIR/issue_62289.rs:+3:22: +3:23
        drop(_5) -> bb9;                 // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
    }

    bb7: {
        StorageDead(_5);                 // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
        _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue_62289.rs:+1:5: +4:6
        drop(_1) -> bb8;                 // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
    }

    bb8: {
        StorageDead(_1);                 // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
        StorageDead(_6);                 // scope 0 at $DIR/issue_62289.rs:+5:1: +5:2
        goto -> bb10;                    // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
    }

    bb9: {
        StorageDead(_5);                 // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
        StorageDead(_1);                 // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
        StorageDead(_6);                 // scope 0 at $DIR/issue_62289.rs:+5:1: +5:2
        goto -> bb10;                    // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
    }

    bb10: {
        return;                          // scope 0 at $DIR/issue_62289.rs:+5:2: +5:2
    }

    bb11 (cleanup): {
        drop(_1) -> [return: bb13, unwind terminate]; // scope 0 at $DIR/issue_62289.rs:+4:5: +4:6
    }

    bb12 (cleanup): {
        drop(_5) -> [return: bb13, unwind terminate]; // scope 0 at $DIR/issue_62289.rs:+3:23: +3:24
    }

    bb13 (cleanup): {
        resume;                          // scope 0 at $DIR/issue_62289.rs:+0:1: +5:2
    }
}