fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
8.1 KiB127 linesraw
1// MIR for `test` before ElaborateDrops
2
3fn test() -> std::option::Option<std::boxed::Box<u32>> {
4    let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue-62289.rs:8:14: 8:30
5    let mut _1: std::boxed::Box<u32>;    // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
6    let mut _2: std::boxed::Box<u32>;    // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21
7    let mut _3: std::result::Result<u32, std::option::NoneError>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
8    let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:19
9    let mut _5: isize;                   // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
10    let _6: std::option::NoneError;      // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
11    let mut _7: !;                       // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
12    let mut _8: std::option::NoneError;  // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
13    let mut _9: std::option::NoneError;  // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
14    let _10: u32;                        // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
15    scope 1 {
16        debug err => _6;                 // in scope 1 at $DIR/issue-62289.rs:9:19: 9:20
17        scope 2 {
18        }
19    }
20    scope 3 {
21        debug val => _10;                // in scope 3 at $DIR/issue-62289.rs:9:15: 9:20
22        scope 4 {
23        }
24    }
25
26    bb0: {
27        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
28        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
29        _2 = Box(u32);                   // bb0[2]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
30        StorageLive(_3);                 // bb0[3]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
31        StorageLive(_4);                 // bb0[4]: scope 0 at $DIR/issue-62289.rs:9:15: 9:19
32        _4 = std::option::Option::<u32>::None; // bb0[5]: scope 0 at $DIR/issue-62289.rs:9:15: 9:19
33        _3 = const <std::option::Option<u32> as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // bb0[6]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
34                                         // ty::Const
35                                         // + ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}
36                                         // + val: Value(Scalar(<ZST>))
37                                         // mir::Constant
38                                         // + span: $DIR/issue-62289.rs:9:15: 9:20
39                                         // + literal: Const { ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) }
40    }
41
42    bb1 (cleanup): {
43        resume;                          // bb1[0]: scope 0 at $DIR/issue-62289.rs:8:1: 10:2
44    }
45
46    bb2: {
47        StorageDead(_4);                 // bb2[0]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
48        _5 = discriminant(_3);           // bb2[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
49        switchInt(move _5) -> [0isize: bb4, 1isize: bb6, otherwise: bb5]; // bb2[2]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
50    }
51
52    bb3 (cleanup): {
53        drop(_2) -> bb1;                 // bb3[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
54    }
55
56    bb4: {
57        StorageLive(_10);                // bb4[0]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
58        _10 = ((_3 as Ok).0: u32);       // bb4[1]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
59        (*_2) = _10;                     // bb4[2]: scope 4 at $DIR/issue-62289.rs:9:15: 9:20
60        StorageDead(_10);                // bb4[3]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
61        _1 = move _2;                    // bb4[4]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
62        drop(_2) -> [return: bb12, unwind: bb11]; // bb4[5]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
63    }
64
65    bb5: {
66        unreachable;                     // bb5[0]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
67    }
68
69    bb6: {
70        StorageLive(_6);                 // bb6[0]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
71        _6 = ((_3 as Err).0: std::option::NoneError); // bb6[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
72        StorageLive(_8);                 // bb6[2]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
73        StorageLive(_9);                 // bb6[3]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
74        _9 = _6;                         // bb6[4]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
75        _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // bb6[5]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
76                                         // ty::Const
77                                         // + ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}
78                                         // + val: Value(Scalar(<ZST>))
79                                         // mir::Constant
80                                         // + span: $DIR/issue-62289.rs:9:19: 9:20
81                                         // + literal: Const { ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}, val: Value(Scalar(<ZST>)) }
82    }
83
84    bb7: {
85        return;                          // bb7[0]: scope 0 at $DIR/issue-62289.rs:10:2: 10:2
86    }
87
88    bb8: {
89        StorageDead(_9);                 // bb8[0]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
90        _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // bb8[1]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
91                                         // ty::Const
92                                         // + ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}
93                                         // + val: Value(Scalar(<ZST>))
94                                         // mir::Constant
95                                         // + span: $DIR/issue-62289.rs:9:15: 9:20
96                                         // + literal: Const { ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) }
97    }
98
99    bb9: {
100        StorageDead(_8);                 // bb9[0]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
101        StorageDead(_6);                 // bb9[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
102        drop(_2) -> bb10;                // bb9[2]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
103    }
104
105    bb10: {
106        StorageDead(_2);                 // bb10[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
107        StorageDead(_1);                 // bb10[1]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
108        StorageDead(_3);                 // bb10[2]: scope 0 at $DIR/issue-62289.rs:10:1: 10:2
109        goto -> bb7;                     // bb10[3]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
110    }
111
112    bb11 (cleanup): {
113        drop(_1) -> bb1;                 // bb11[0]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
114    }
115
116    bb12: {
117        StorageDead(_2);                 // bb12[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
118        _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // bb12[1]: scope 0 at $DIR/issue-62289.rs:9:5: 9:22
119        drop(_1) -> bb13;                // bb12[2]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
120    }
121
122    bb13: {
123        StorageDead(_1);                 // bb13[0]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
124        StorageDead(_3);                 // bb13[1]: scope 0 at $DIR/issue-62289.rs:10:1: 10:2
125        goto -> bb7;                     // bb13[2]: scope 0 at $DIR/issue-62289.rs:10:2: 10:2
126    }
127}