]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
Bless test output
[rust.git] / src / test / mir-opt / issue_62289.test.ElaborateDrops.before.mir
1 // MIR for `test` before ElaborateDrops
2
3 fn test() -> Option<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);                 // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
28         StorageLive(_2);                 // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
29         _2 = Box(u32);                   // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
30         StorageLive(_3);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
31         StorageLive(_4);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
32         _4 = Option::<u32>::None;        // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
33         _3 = <Option<u32> as Try>::into_result(move _4) -> [return: bb1, unwind: bb10]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
34                                          // mir::Constant
35                                          // + span: $DIR/issue-62289.rs:9:15: 9:20
36                                          // + 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>)) }
37     }
38
39     bb1: {
40         StorageDead(_4);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
41         _5 = discriminant(_3);           // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
42         switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
43     }
44
45     bb2: {
46         StorageLive(_10);                // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
47         _10 = ((_3 as Ok).0: u32);       // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
48         (*_2) = _10;                     // scope 4 at $DIR/issue-62289.rs:9:15: 9:20
49         StorageDead(_10);                // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
50         _1 = move _2;                    // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
51         StorageDead(_2);                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
52         _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
53         StorageDead(_1);                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
54         StorageDead(_3);                 // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
55         goto -> bb8;                     // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
56     }
57
58     bb3: {
59         unreachable;                     // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
60     }
61
62     bb4: {
63         StorageLive(_6);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
64         _6 = ((_3 as Err).0: std::option::NoneError); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
65         StorageLive(_8);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
66         StorageLive(_9);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
67         _9 = _6;                         // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
68         _8 = <NoneError as From<NoneError>>::from(move _9) -> [return: bb5, unwind: bb10]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
69                                          // mir::Constant
70                                          // + span: $DIR/issue-62289.rs:9:19: 9:20
71                                          // + 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>)) }
72     }
73
74     bb5: {
75         StorageDead(_9);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
76         _0 = <Option<Box<u32>> as Try>::from_error(move _8) -> [return: bb6, unwind: bb10]; // scope 2 at $DIR/issue-62289.rs:9:15: 9:20
77                                          // mir::Constant
78                                          // + span: $DIR/issue-62289.rs:9:15: 9:20
79                                          // + 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>)) }
80     }
81
82     bb6: {
83         StorageDead(_8);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
84         StorageDead(_6);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
85         drop(_2) -> [return: bb7, unwind: bb9]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
86     }
87
88     bb7: {
89         StorageDead(_2);                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
90         StorageDead(_1);                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
91         StorageDead(_3);                 // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
92         goto -> bb8;                     // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
93     }
94
95     bb8: {
96         return;                          // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
97     }
98
99     bb9 (cleanup): {
100         drop(_0) -> bb11;                // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
101     }
102
103     bb10 (cleanup): {
104         drop(_2) -> bb11;                // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
105     }
106
107     bb11 (cleanup): {
108         resume;                          // scope 0 at $DIR/issue-62289.rs:8:1: 10:2
109     }
110 }