]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir
Rollup merge of #71051 - ryr3:fix_try_into, r=estebank
[rust.git] / src / test / mir-opt / match-arm-scopes / rustc.complicated_match.SimplifyCfg-initial.after.mir
1 // MIR for `complicated_match` after SimplifyCfg-initial
2
3 fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
4     debug cond => _1;                    // in scope 0 at $DIR/match-arm-scopes.rs:14:22: 14:26
5     debug items => _2;                   // in scope 0 at $DIR/match-arm-scopes.rs:14:34: 14:39
6     let mut _0: i32;                     // return place in scope 0 at $DIR/match-arm-scopes.rs:14:66: 14:69
7     let mut _3: &bool;                   // in scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
8     let mut _4: &bool;                   // in scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
9     let _5: bool;                        // in scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
10     let _6: &bool;                       // in scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
11     let _7: std::string::String;         // in scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
12     let _8: &std::string::String;        // in scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
13     let mut _9: bool;                    // in scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
14     let mut _10: bool;                   // in scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
15     let mut _11: !;                      // in scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
16     let mut _12: bool;                   // in scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
17     let mut _13: bool;                   // in scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
18     let mut _14: !;                      // in scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
19     let _15: bool;                       // in scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
20     let _16: std::string::String;        // in scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
21     scope 1 {
22         debug a => _5;                   // in scope 1 at $DIR/match-arm-scopes.rs:16:17: 16:18
23         debug a => _6;                   // in scope 1 at $DIR/match-arm-scopes.rs:16:17: 16:18
24         debug s => _7;                   // in scope 1 at $DIR/match-arm-scopes.rs:16:20: 16:21
25         debug s => _8;                   // in scope 1 at $DIR/match-arm-scopes.rs:16:20: 16:21
26     }
27     scope 2 {
28         debug b => _15;                  // in scope 2 at $DIR/match-arm-scopes.rs:17:16: 17:17
29         debug t => _16;                  // in scope 2 at $DIR/match-arm-scopes.rs:17:19: 17:20
30     }
31
32     bb0: {
33         FakeRead(ForMatchedPlace, _2);   // bb0[0]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
34         switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3]; // bb0[1]: scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
35     }
36
37     bb1 (cleanup): {
38         resume;                          // bb1[0]: scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
39     }
40
41     bb2: {
42         falseEdges -> [real: bb9, imaginary: bb4]; // bb2[0]: scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:22
43     }
44
45     bb3: {
46         switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5]; // bb3[0]: scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
47     }
48
49     bb4: {
50         falseEdges -> [real: bb18, imaginary: bb6]; // bb4[0]: scope 0 at $DIR/match-arm-scopes.rs:16:25: 16:38
51     }
52
53     bb5: {
54         switchInt((_2.0: bool)) -> [false: bb7, otherwise: bb6]; // bb5[0]: scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
55     }
56
57     bb6: {
58         falseEdges -> [real: bb26, imaginary: bb7]; // bb6[0]: scope 0 at $DIR/match-arm-scopes.rs:17:9: 17:21
59     }
60
61     bb7: {
62         StorageLive(_15);                // bb7[0]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
63         _15 = (_2.1: bool);              // bb7[1]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
64         StorageLive(_16);                // bb7[2]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
65         _16 = move (_2.2: std::string::String); // bb7[3]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
66         goto -> bb25;                    // bb7[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
67     }
68
69     bb8: {
70         _0 = const 1i32;                 // bb8[0]: scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
71                                          // ty::Const
72                                          // + ty: i32
73                                          // + val: Value(Scalar(0x00000001))
74                                          // mir::Constant
75                                          // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
76                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
77         drop(_7) -> [return: bb24, unwind: bb14]; // bb8[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
78     }
79
80     bb9: {
81         StorageLive(_6);                 // bb9[0]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
82         _6 = &(_2.1: bool);              // bb9[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
83         StorageLive(_8);                 // bb9[2]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
84         _8 = &(_2.2: std::string::String); // bb9[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
85         _3 = &shallow (_2.0: bool);      // bb9[4]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
86         _4 = &shallow (_2.1: bool);      // bb9[5]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
87         StorageLive(_9);                 // bb9[6]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
88         StorageLive(_10);                // bb9[7]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
89         _10 = _1;                        // bb9[8]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
90         FakeRead(ForMatchedPlace, _10);  // bb9[9]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
91         switchInt(_10) -> [false: bb11, otherwise: bb10]; // bb9[10]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
92     }
93
94     bb10: {
95         falseEdges -> [real: bb12, imaginary: bb11]; // bb10[0]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
96     }
97
98     bb11: {
99         _9 = (*_6);                      // bb11[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
100         StorageDead(_10);                // bb11[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
101         switchInt(move _9) -> [false: bb17, otherwise: bb16]; // bb11[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
102     }
103
104     bb12: {
105         _0 = const 3i32;                 // bb12[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
106                                          // ty::Const
107                                          // + ty: i32
108                                          // + val: Value(Scalar(0x00000003))
109                                          // mir::Constant
110                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
111                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
112         StorageDead(_10);                // bb12[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
113         StorageDead(_9);                 // bb12[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
114         StorageDead(_8);                 // bb12[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
115         StorageDead(_6);                 // bb12[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
116         goto -> bb15;                    // bb12[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
117     }
118
119     bb13: {
120         return;                          // bb13[0]: scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
121     }
122
123     bb14 (cleanup): {
124         drop(_2) -> bb1;                 // bb14[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
125     }
126
127     bb15: {
128         drop(_2) -> [return: bb13, unwind: bb1]; // bb15[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
129     }
130
131     bb16: {
132         StorageDead(_9);                 // bb16[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
133         FakeRead(ForMatchGuard, _3);     // bb16[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
134         FakeRead(ForMatchGuard, _4);     // bb16[2]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
135         FakeRead(ForGuardBinding, _6);   // bb16[3]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
136         FakeRead(ForGuardBinding, _8);   // bb16[4]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
137         StorageLive(_5);                 // bb16[5]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
138         _5 = (_2.1: bool);               // bb16[6]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
139         StorageLive(_7);                 // bb16[7]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
140         _7 = move (_2.2: std::string::String); // bb16[8]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
141         goto -> bb8;                     // bb16[9]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
142     }
143
144     bb17: {
145         StorageDead(_9);                 // bb17[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
146         StorageDead(_8);                 // bb17[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
147         StorageDead(_6);                 // bb17[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
148         falseEdges -> [real: bb3, imaginary: bb4]; // bb17[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
149     }
150
151     bb18: {
152         StorageLive(_6);                 // bb18[0]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
153         _6 = &(_2.0: bool);              // bb18[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
154         StorageLive(_8);                 // bb18[2]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
155         _8 = &(_2.2: std::string::String); // bb18[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
156         _3 = &shallow (_2.0: bool);      // bb18[4]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
157         _4 = &shallow (_2.1: bool);      // bb18[5]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
158         StorageLive(_12);                // bb18[6]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
159         StorageLive(_13);                // bb18[7]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
160         _13 = _1;                        // bb18[8]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
161         FakeRead(ForMatchedPlace, _13);  // bb18[9]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
162         switchInt(_13) -> [false: bb20, otherwise: bb19]; // bb18[10]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
163     }
164
165     bb19: {
166         falseEdges -> [real: bb21, imaginary: bb20]; // bb19[0]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
167     }
168
169     bb20: {
170         _12 = (*_6);                     // bb20[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
171         StorageDead(_13);                // bb20[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
172         switchInt(move _12) -> [false: bb23, otherwise: bb22]; // bb20[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
173     }
174
175     bb21: {
176         _0 = const 3i32;                 // bb21[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
177                                          // ty::Const
178                                          // + ty: i32
179                                          // + val: Value(Scalar(0x00000003))
180                                          // mir::Constant
181                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
182                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
183         StorageDead(_13);                // bb21[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
184         StorageDead(_12);                // bb21[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
185         StorageDead(_8);                 // bb21[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
186         StorageDead(_6);                 // bb21[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
187         goto -> bb15;                    // bb21[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
188     }
189
190     bb22: {
191         StorageDead(_12);                // bb22[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
192         FakeRead(ForMatchGuard, _3);     // bb22[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
193         FakeRead(ForMatchGuard, _4);     // bb22[2]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
194         FakeRead(ForGuardBinding, _6);   // bb22[3]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
195         FakeRead(ForGuardBinding, _8);   // bb22[4]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
196         StorageLive(_5);                 // bb22[5]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
197         _5 = (_2.0: bool);               // bb22[6]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
198         StorageLive(_7);                 // bb22[7]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
199         _7 = move (_2.2: std::string::String); // bb22[8]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
200         goto -> bb8;                     // bb22[9]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
201     }
202
203     bb23: {
204         StorageDead(_12);                // bb23[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
205         StorageDead(_8);                 // bb23[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
206         StorageDead(_6);                 // bb23[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
207         falseEdges -> [real: bb5, imaginary: bb6]; // bb23[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
208     }
209
210     bb24: {
211         StorageDead(_7);                 // bb24[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
212         StorageDead(_5);                 // bb24[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
213         StorageDead(_8);                 // bb24[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
214         StorageDead(_6);                 // bb24[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
215         goto -> bb28;                    // bb24[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
216     }
217
218     bb25: {
219         _0 = const 2i32;                 // bb25[0]: scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
220                                          // ty::Const
221                                          // + ty: i32
222                                          // + val: Value(Scalar(0x00000002))
223                                          // mir::Constant
224                                          // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
225                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
226         drop(_16) -> [return: bb27, unwind: bb14]; // bb25[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
227     }
228
229     bb26: {
230         StorageLive(_15);                // bb26[0]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
231         _15 = (_2.1: bool);              // bb26[1]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
232         StorageLive(_16);                // bb26[2]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
233         _16 = move (_2.2: std::string::String); // bb26[3]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
234         goto -> bb25;                    // bb26[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
235     }
236
237     bb27: {
238         StorageDead(_16);                // bb27[0]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
239         StorageDead(_15);                // bb27[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
240         goto -> bb28;                    // bb27[2]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
241     }
242
243     bb28: {
244         drop(_2) -> [return: bb13, unwind: bb1]; // bb28[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
245     }
246 }