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