]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/issue_41888.main.ElaborateDrops.after.mir
Rollup merge of #76088 - hbina:add_example, r=LukasKalbertodt
[rust.git] / src / test / mir-opt / issue_41888.main.ElaborateDrops.after.mir
1 // MIR for `main` after ElaborateDrops
2
3 fn main() -> () {
4     let mut _0: ();                      // return place in scope 0 at $DIR/issue-41888.rs:6:11: 6:11
5     let _1: E;                           // in scope 0 at $DIR/issue-41888.rs:7:9: 7:10
6     let mut _2: bool;                    // in scope 0 at $DIR/issue-41888.rs:8:8: 8:14
7     let mut _3: E;                       // in scope 0 at $DIR/issue-41888.rs:9:13: 9:20
8     let mut _4: K;                       // in scope 0 at $DIR/issue-41888.rs:9:18: 9:19
9     let mut _5: isize;                   // in scope 0 at $DIR/issue-41888.rs:10:16: 10:24
10     let mut _7: bool;                    // in scope 0 at $DIR/issue-41888.rs:15:1: 15:2
11     let mut _8: bool;                    // in scope 0 at $DIR/issue-41888.rs:15:1: 15:2
12     let mut _9: bool;                    // in scope 0 at $DIR/issue-41888.rs:15:1: 15:2
13     let mut _10: isize;                  // in scope 0 at $DIR/issue-41888.rs:15:1: 15:2
14     let mut _11: isize;                  // in scope 0 at $DIR/issue-41888.rs:15:1: 15:2
15     scope 1 {
16         debug e => _1;                   // in scope 1 at $DIR/issue-41888.rs:7:9: 7:10
17         let _6: K;                       // in scope 1 at $DIR/issue-41888.rs:10:21: 10:23
18         scope 2 {
19             debug _k => _6;              // in scope 2 at $DIR/issue-41888.rs:10:21: 10:23
20         }
21     }
22
23     bb0: {
24         _9 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
25         _7 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
26         _8 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
27         StorageLive(_1);                 // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
28         StorageLive(_2);                 // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
29         _2 = cond() -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
30                                          // mir::Constant
31                                          // + span: $DIR/issue-41888.rs:8:8: 8:12
32                                          // + literal: Const { ty: fn() -> bool {cond}, val: Value(Scalar(<ZST>)) }
33     }
34
35     bb1 (cleanup): {
36         resume;                          // scope 0 at $DIR/issue-41888.rs:6:1: 15:2
37     }
38
39     bb2: {
40         switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
41     }
42
43     bb3 (cleanup): {
44         goto -> bb1;                     // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
45     }
46
47     bb4: {
48         _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
49         goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
50     }
51
52     bb5: {
53         StorageLive(_3);                 // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
54         StorageLive(_4);                 // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
55         _4 = K;                          // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
56         _3 = E::F(move _4);              // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
57         StorageDead(_4);                 // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
58         goto -> bb14;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
59     }
60
61     bb6: {
62         goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
63     }
64
65     bb7 (cleanup): {
66         goto -> bb3;                     // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
67     }
68
69     bb8: {
70         StorageDead(_3);                 // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
71         _5 = discriminant(_1);           // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
72         switchInt(move _5) -> [0_isize: bb10, otherwise: bb9]; // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
73     }
74
75     bb9: {
76         _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
77         goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
78     }
79
80     bb10: {
81         StorageLive(_6);                 // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
82         _9 = const false;                // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
83         _6 = move ((_1 as F).0: K);      // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
84         _0 = const ();                   // scope 2 at $DIR/issue-41888.rs:10:29: 13:10
85         StorageDead(_6);                 // scope 1 at $DIR/issue-41888.rs:13:9: 13:10
86         goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
87     }
88
89     bb11: {
90         goto -> bb21;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
91     }
92
93     bb12: {
94         _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
95         _8 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
96         _9 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
97         StorageDead(_1);                 // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
98         StorageDead(_2);                 // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
99         return;                          // scope 0 at $DIR/issue-41888.rs:15:2: 15:2
100     }
101
102     bb13 (cleanup): {
103         _7 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
104         _8 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
105         _9 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
106         _1 = move _3;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
107         goto -> bb7;                     // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
108     }
109
110     bb14: {
111         _7 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
112         _8 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
113         _9 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
114         _1 = move _3;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
115         goto -> bb6;                     // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
116     }
117
118     bb15: {
119         _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
120         goto -> bb12;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
121     }
122
123     bb16 (cleanup): {
124         _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
125         goto -> bb1;                     // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
126     }
127
128     bb17 (cleanup): {
129         goto -> bb16;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
130     }
131
132     bb18: {
133         drop(_1) -> [return: bb15, unwind: bb16]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
134     }
135
136     bb19 (cleanup): {
137         drop(_1) -> bb16;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
138     }
139
140     bb20: {
141         _10 = discriminant(_1);          // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
142         switchInt(move _10) -> [0_isize: bb15, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
143     }
144
145     bb21: {
146         switchInt(_7) -> [false: bb15, otherwise: bb20]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
147     }
148
149     bb22 (cleanup): {
150         _11 = discriminant(_1);          // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
151         switchInt(move _11) -> [0_isize: bb17, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
152     }
153
154     bb23 (cleanup): {
155         switchInt(_7) -> [false: bb16, otherwise: bb22]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
156     }
157 }