]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/issue_62289.test.ElaborateDrops.before.mir
Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyup
[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::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // 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::Option<std::convert::Infallible>; // 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::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20
13     let _9: u32;                         // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20
14     scope 1 {
15         debug residual => _6;            // in scope 1 at $DIR/issue-62289.rs:9:19: 9:20
16         scope 2 {
17         }
18     }
19     scope 3 {
20         debug val => _9;                 // in scope 3 at $DIR/issue-62289.rs:9:15: 9:20
21         scope 4 {
22         }
23     }
24
25     bb0: {
26         StorageLive(_1);                 // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
27         StorageLive(_2);                 // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
28         _2 = Box(u32);                   // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
29         StorageLive(_3);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
30         StorageLive(_4);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
31         _4 = Option::<u32>::None;        // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
32         _3 = <Option<u32> as Try>::branch(move _4) -> [return: bb1, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
33                                          // mir::Constant
34                                          // + span: $DIR/issue-62289.rs:9:15: 9:20
35                                          // + literal: Const { ty: fn(std::option::Option<u32>) -> std::ops::ControlFlow<<std::option::Option<u32> as std::ops::Try>::Residual, <std::option::Option<u32> as std::ops::Try>::Output> {<std::option::Option<u32> as std::ops::Try>::branch}, val: Value(Scalar(<ZST>)) }
36     }
37
38     bb1: {
39         StorageDead(_4);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
40         _5 = discriminant(_3);           // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
41         switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
42     }
43
44     bb2: {
45         StorageLive(_9);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
46         _9 = ((_3 as Continue).0: u32);  // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
47         (*_2) = _9;                      // scope 4 at $DIR/issue-62289.rs:9:15: 9:20
48         StorageDead(_9);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
49         _1 = move _2;                    // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
50         drop(_2) -> [return: bb6, unwind: bb10]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
51     }
52
53     bb3: {
54         unreachable;                     // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
55     }
56
57     bb4: {
58         StorageLive(_6);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
59         _6 = ((_3 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
60         StorageLive(_8);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
61         _8 = _6;                         // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
62         _0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _8) -> [return: bb5, unwind: bb11]; // scope 2 at $DIR/issue-62289.rs:9:15: 9:20
63                                          // mir::Constant
64                                          // + span: $DIR/issue-62289.rs:9:19: 9:20
65                                          // + literal: Const { ty: fn(std::option::Option<std::convert::Infallible>) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::FromResidual<std::option::Option<std::convert::Infallible>>>::from_residual}, val: Value(Scalar(<ZST>)) }
66     }
67
68     bb5: {
69         StorageDead(_8);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
70         StorageDead(_6);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
71         drop(_2) -> bb8;                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
72     }
73
74     bb6: {
75         StorageDead(_2);                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
76         _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
77         drop(_1) -> bb7;                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
78     }
79
80     bb7: {
81         StorageDead(_1);                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
82         StorageDead(_3);                 // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
83         goto -> bb9;                     // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
84     }
85
86     bb8: {
87         StorageDead(_2);                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
88         StorageDead(_1);                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
89         StorageDead(_3);                 // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
90         goto -> bb9;                     // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
91     }
92
93     bb9: {
94         return;                          // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
95     }
96
97     bb10 (cleanup): {
98         drop(_1) -> bb12;                // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
99     }
100
101     bb11 (cleanup): {
102         drop(_2) -> bb12;                // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
103     }
104
105     bb12 (cleanup): {
106         resume;                          // scope 0 at $DIR/issue-62289.rs:8:1: 10:2
107     }
108 }