@@ -28,10 +28,7 @@ const CASES: &[(bool, bool, bool, i32)] = &[
28
28
29
29
fn main ( ) {
30
30
for & ( cond, items_1, items_2, result) in CASES {
31
- assert_eq ! (
32
- complicated_match( cond, ( items_1, items_2, String :: new( ) ) ) ,
33
- result,
34
- ) ;
31
+ assert_eq ! ( complicated_match( cond, ( items_1, items_2, String :: new( ) ) ) , result, ) ;
35
32
}
36
33
}
37
34
@@ -64,31 +61,38 @@ fn main() {
64
61
// }
65
62
// bb0: {
66
63
// FakeRead(ForMatchedPlace, _2);
67
- // switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb5 ];
64
+ // switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3 ];
68
65
// }
69
66
// bb1 (cleanup): {
70
67
// resume;
71
68
// }
72
- // bb2: {
73
- // falseEdges -> [real: bb8 , imaginary: bb3 ];
69
+ // bb2: { // pre-binding for arm 1 first pattern
70
+ // falseEdges -> [real: bb9 , imaginary: bb4 ];
74
71
// }
75
72
// bb3: {
76
- // falseEdges -> [real: bb17, imaginary: bb4 ];
73
+ // switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5 ];
77
74
// }
78
- // bb4: {
79
- // falseEdges -> [real: bb25 , imaginary: bb26 ];
75
+ // bb4: { // pre-binding for arm 1 second pattern
76
+ // falseEdges -> [real: bb18 , imaginary: bb6 ];
80
77
// }
81
78
// bb5: {
82
- // switchInt((_2.1 : bool)) -> [false: bb3 , otherwise: bb6];
79
+ // switchInt((_2.0 : bool)) -> [false: bb7 , otherwise: bb6];
83
80
// }
84
- // bb6: {
85
- // switchInt((_2.0: bool)) -> [false : bb26, otherwise: bb4 ];
81
+ // bb6: { // pre-binding for arm 2 first pattern
82
+ // falseEdges -> [real : bb26, imaginary: bb7 ];
86
83
// }
87
- // bb7: { // arm 1
84
+ // bb7: { // bindings for arm 2 - second pattern
85
+ // StorageLive(_15);
86
+ // _15 = (_2.1: bool);
87
+ // StorageLive(_16);
88
+ // _16 = move (_2.2: std::string::String);
89
+ // goto -> bb25;
90
+ // }
91
+ // bb8: { // arm 1
88
92
// _0 = const 1i32;
89
- // drop(_7) -> [return: bb23 , unwind: bb13 ];
93
+ // drop(_7) -> [return: bb24 , unwind: bb14 ];
90
94
// }
91
- // bb8 : { // guard - first time
95
+ // bb9 : { // guard - first time
92
96
// StorageLive(_6);
93
97
// _6 = &(_2.1: bool);
94
98
// StorageLive(_8);
@@ -99,34 +103,34 @@ fn main() {
99
103
// StorageLive(_10);
100
104
// _10 = _1;
101
105
// FakeRead(ForMatchedPlace, _10);
102
- // switchInt(_10) -> [false: bb10 , otherwise: bb9 ];
106
+ // switchInt(_10) -> [false: bb11 , otherwise: bb10 ];
103
107
// }
104
- // bb9 : {
105
- // falseEdges -> [real: bb11 , imaginary: bb10 ];
108
+ // bb10 : {
109
+ // falseEdges -> [real: bb12 , imaginary: bb11 ];
106
110
// }
107
- // bb10 : { // `else` block - first time
111
+ // bb11 : { // `else` block - first time
108
112
// _9 = (*_6);
109
113
// StorageDead(_10);
110
- // switchInt(move _9) -> [false: bb16 , otherwise: bb15 ];
114
+ // switchInt(move _9) -> [false: bb17 , otherwise: bb16 ];
111
115
// }
112
- // bb11 : { // `return 3` - first time
116
+ // bb12 : { // `return 3` - first time
113
117
// _0 = const 3i32;
114
118
// StorageDead(_10);
115
119
// StorageDead(_9);
116
120
// StorageDead(_8);
117
121
// StorageDead(_6);
118
- // goto -> bb14 ;
122
+ // goto -> bb15 ;
119
123
// }
120
- // bb12 : {
124
+ // bb13 : {
121
125
// return;
122
126
// }
123
- // bb13 (cleanup): {
127
+ // bb14 (cleanup): {
124
128
// drop(_2) -> bb1;
125
129
// }
126
- // bb14: {
127
- // drop(_2) -> [return: bb12, unwind: bb1];
128
- // }
129
130
// bb15: {
131
+ // drop(_2) -> [return: bb13, unwind: bb1];
132
+ // }
133
+ // bb16: {
130
134
// StorageDead(_9);
131
135
// FakeRead(ForMatchGuard, _3);
132
136
// FakeRead(ForMatchGuard, _4);
@@ -136,15 +140,15 @@ fn main() {
136
140
// _5 = (_2.1: bool);
137
141
// StorageLive(_7);
138
142
// _7 = move (_2.2: std::string::String);
139
- // goto -> bb7 ;
143
+ // goto -> bb8 ;
140
144
// }
141
- // bb16 : { // guard otherwise case - first time
145
+ // bb17 : { // guard otherwise case - first time
142
146
// StorageDead(_9);
143
147
// StorageDead(_8);
144
148
// StorageDead(_6);
145
- // falseEdges -> [real: bb5 , imaginary: bb3 ];
149
+ // falseEdges -> [real: bb3 , imaginary: bb4 ];
146
150
// }
147
- // bb17 : { // guard - second time
151
+ // bb18 : { // guard - second time
148
152
// StorageLive(_6);
149
153
// _6 = &(_2.0: bool);
150
154
// StorageLive(_8);
@@ -155,25 +159,25 @@ fn main() {
155
159
// StorageLive(_13);
156
160
// _13 = _1;
157
161
// FakeRead(ForMatchedPlace, _13);
158
- // switchInt(_13) -> [false: bb19 , otherwise: bb18 ];
162
+ // switchInt(_13) -> [false: bb20 , otherwise: bb19 ];
159
163
// }
160
- // bb18 : {
161
- // falseEdges -> [real: bb20 , imaginary: bb19 ];
164
+ // bb19 : {
165
+ // falseEdges -> [real: bb21 , imaginary: bb20 ];
162
166
// }
163
- // bb19 : { // `else` block - second time
167
+ // bb20 : { // `else` block - second time
164
168
// _12 = (*_6);
165
169
// StorageDead(_13);
166
- // switchInt(move _12) -> [false: bb22 , otherwise: bb21 ];
170
+ // switchInt(move _12) -> [false: bb23 , otherwise: bb22 ];
167
171
// }
168
- // bb20 : {
172
+ // bb21 : {
169
173
// _0 = const 3i32;
170
174
// StorageDead(_13);
171
175
// StorageDead(_12);
172
176
// StorageDead(_8);
173
177
// StorageDead(_6);
174
- // goto -> bb14 ;
178
+ // goto -> bb15 ;
175
179
// }
176
- // bb21 : { // bindings for arm 1
180
+ // bb22 : { // bindings for arm 1
177
181
// StorageDead(_12);
178
182
// FakeRead(ForMatchGuard, _3);
179
183
// FakeRead(ForMatchGuard, _4);
@@ -183,46 +187,40 @@ fn main() {
183
187
// _5 = (_2.0: bool);
184
188
// StorageLive(_7);
185
189
// _7 = move (_2.2: std::string::String);
186
- // goto -> bb7 ;
190
+ // goto -> bb8 ;
187
191
// }
188
- // bb22 : { // Guard otherwise case - second time
192
+ // bb23 : { // Guard otherwise case - second time
189
193
// StorageDead(_12);
190
194
// StorageDead(_8);
191
195
// StorageDead(_6);
192
- // falseEdges -> [real: bb6 , imaginary: bb4 ];
196
+ // falseEdges -> [real: bb5 , imaginary: bb6 ];
193
197
// }
194
- // bb23 : { // rest of arm 1
198
+ // bb24 : { // rest of arm 1
195
199
// StorageDead(_7);
196
200
// StorageDead(_5);
197
201
// StorageDead(_8);
198
202
// StorageDead(_6);
199
203
// goto -> bb28;
200
204
// }
201
- // bb24 : { // arm 2
205
+ // bb25 : { // arm 2
202
206
// _0 = const 2i32;
203
- // drop(_16) -> [return: bb27, unwind: bb13 ];
207
+ // drop(_16) -> [return: bb27, unwind: bb14 ];
204
208
// }
205
- // bb25 : { // bindings for arm 2 - first pattern
209
+ // bb26 : { // bindings for arm 2 - first pattern
206
210
// StorageLive(_15);
207
211
// _15 = (_2.1: bool);
208
212
// StorageLive(_16);
209
213
// _16 = move (_2.2: std::string::String);
210
- // goto -> bb24;
211
- // }
212
- // bb26: { // bindings for arm 2 - second pattern
213
- // StorageLive(_15);
214
- // _15 = (_2.1: bool);
215
- // StorageLive(_16);
216
- // _16 = move (_2.2: std::string::String);
217
- // goto -> bb24;
214
+ // goto -> bb25;
218
215
// }
216
+
219
217
// bb27: { // rest of arm 2
220
218
// StorageDead(_16);
221
219
// StorageDead(_15);
222
220
// goto -> bb28;
223
221
// }
224
222
// bb28: {
225
- // drop(_2) -> [return: bb12 , unwind: bb1];
223
+ // drop(_2) -> [return: bb13 , unwind: bb1];
226
224
// }
227
225
// END rustc.complicated_match.SimplifyCfg-initial.after.mir
228
226
// START rustc.complicated_match.ElaborateDrops.after.mir
0 commit comments