@@ -53,10 +53,11 @@ fn main() {
5353//  bb0: { 
5454//      ... 
5555//      _2 = std::option::Option<i32>::Some(const 42i32,); 
56- //      _3 = discriminant(_2); 
57- //      _4 = &(promoted[1]: std::option::Option<i32>); 
58- //      _9 = discriminant(_2); 
59- //      switchInt(move _9) -> [0isize: bb5, 1isize: bb3, otherwise: bb7]; 
56+ //      FakeRead(ForMatchedPlace, _2); 
57+ //      _7 = discriminant(_2); 
58+ //      _9 = &shallow (promoted[2]: std::option::Option<i32>); 
59+ //      _10 = &(((promoted[1]: std::option::Option<i32>) as Some).0: i32); 
60+ //      switchInt(move _7) -> [0isize: bb5, 1isize: bb3, otherwise: bb7]; 
6061//  } 
6162//  bb1: { 
6263//      resume; 
@@ -66,15 +67,18 @@ fn main() {
6667//      goto -> bb13; 
6768//  } 
6869//  bb3: { // binding3(empty) and arm3 
69- //      FakeRead(ForMatch, _4); 
70+ //      FakeRead(ForMatchGuard, _9); 
71+ //      FakeRead(ForMatchGuard, _10); 
7072//      falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1 
7173//  } 
7274//  bb4: { 
73- //      FakeRead(ForMatch, _4); 
75+ //      FakeRead(ForMatchGuard, _9); 
76+ //      FakeRead(ForMatchGuard, _10); 
7477//      falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding2 
7578//  } 
7679//  bb5: { 
77- //      FakeRead(ForMatch, _4); 
80+ //      FakeRead(ForMatchGuard, _9); 
81+ //      FakeRead(ForMatchGuard, _10); 
7882//      falseEdges -> [real: bb2, imaginary: bb6]; //pre_binding3 
7983//  } 
8084//  bb6: { 
@@ -84,31 +88,31 @@ fn main() {
8488//      unreachable; 
8589//  } 
8690//  bb8: { // binding1 and guard 
87- //      StorageLive(_7 ); 
88- //      _7  = &(((promoted[0]: std::option::Option<i32>) as Some).0: i32); 
89- //      StorageLive(_10 ); 
90- //      _10  = const guard() -> [return: bb9, unwind: bb1]; 
91+ //      StorageLive(_5 ); 
92+ //      _5  = &(((promoted[0]: std::option::Option<i32>) as Some).0: i32); 
93+ //      StorageLive(_8 ); 
94+ //      _8  = const guard() -> [return: bb9, unwind: bb1]; 
9195//  } 
9296//  bb9: { 
93- //      switchInt(move _10 ) -> [false: bb10, otherwise: bb11]; 
97+ //      switchInt(move _8 ) -> [false: bb10, otherwise: bb11]; 
9498//  } 
9599//  bb10: { // to pre_binding2 
96100//      falseEdges -> [real: bb4, imaginary: bb4]; 
97101//  } 
98102//  bb11: { // bindingNoLandingPads.before.mir2 and arm2 
99- //      StorageLive(_5 ); 
100- //      _5  = ((_2 as Some).0: i32); 
103+ //      StorageLive(_3 ); 
104+ //      _3  = ((_2 as Some).0: i32); 
101105//      StorageLive(_11); 
102- //      _11 = _5 ; 
106+ //      _11 = _3 ; 
103107//      _1 = (const 1i32, move _11); 
104108//      StorageDead(_11); 
105109//      goto -> bb13; 
106110//  } 
107111//  bb12: { 
108- //      StorageLive(_8 ); 
109- //      _8  = ((_2 as Some).0: i32); 
112+ //      StorageLive(_6 ); 
113+ //      _6  = ((_2 as Some).0: i32); 
110114//      StorageLive(_12); 
111- //      _12 = _8 ; 
115+ //      _12 = _6 ; 
112116//      _1 = (const 2i32, move_12); 
113117//      StorageDead(_12); 
114118//      goto -> bb13; 
@@ -123,10 +127,11 @@ fn main() {
123127//  bb0: { 
124128//      ... 
125129//      _2 = std::option::Option<i32>::Some(const 42i32,); 
126- //      _3 = discriminant(_2); 
127- //      _4 = &_2; 
128- //      _9 = discriminant(_2); 
129- //      switchInt(move _9) -> [0isize: bb4, 1isize: bb3, otherwise: bb7]; 
130+ //      FakeRead(ForMatchedPlace, _2); 
131+ //      _7 = discriminant(_2); 
132+ //      _9 = &shallow _2; 
133+ //      _10 = &((_2 as Some).0: i32); 
134+ //      switchInt(move _7) -> [0isize: bb4, 1isize: bb3, otherwise: bb7]; 
130135//  } 
131136//  bb1: { 
132137//      resume; 
@@ -136,15 +141,18 @@ fn main() {
136141//      goto -> bb13; 
137142//  } 
138143//  bb3: { 
139- //      FakeRead(ForMatch, _4); 
144+ //      FakeRead(ForMatchGuard, _9); 
145+ //      FakeRead(ForMatchGuard, _10); 
140146//      falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1 
141147//  } 
142148//  bb4: { 
143- //      FakeRead(ForMatch, _4); 
149+ //      FakeRead(ForMatchGuard, _9); 
150+ //      FakeRead(ForMatchGuard, _10); 
144151//      falseEdges -> [real: bb2, imaginary: bb5]; //pre_binding2 
145152//  } 
146153//  bb5: { 
147- //      FakeRead(ForMatch, _4); 
154+ //      FakeRead(ForMatchGuard, _9); 
155+ //      FakeRead(ForMatchGuard, _10); 
148156//      falseEdges -> [real: bb12, imaginary: bb6]; //pre_binding3 
149157//  } 
150158//  bb6: { 
@@ -154,31 +162,31 @@ fn main() {
154162//      unreachable; 
155163//  } 
156164//  bb8: { // binding1 and guard 
157- //      StorageLive(_7 ); 
158- //      _7  = &((_2 as Some).0: i32); 
159- //      StorageLive(_10 ); 
160- //      _10  = const guard() -> [return: bb9, unwind: bb1]; 
165+ //      StorageLive(_5 ); 
166+ //      _5  = &((_2 as Some).0: i32); 
167+ //      StorageLive(_8 ); 
168+ //      _8  = const guard() -> [return: bb9, unwind: bb1]; 
161169//  } 
162170//  bb9: { // end of guard 
163- //      switchInt(move _10 ) -> [false: bb10, otherwise: bb11]; 
171+ //      switchInt(move _8 ) -> [false: bb10, otherwise: bb11]; 
164172//  } 
165173//  bb10: { // to pre_binding3 (can skip 2 since this is `Some`) 
166174//      falseEdges -> [real: bb5, imaginary: bb4]; 
167175//  } 
168176//  bb11: { // arm1 
169- //      StorageLive(_5 ); 
170- //      _5  = ((_2 as Some).0: i32); 
177+ //      StorageLive(_3 ); 
178+ //      _3  = ((_2 as Some).0: i32); 
171179//      StorageLive(_11); 
172- //      _11 = _5 ; 
180+ //      _11 = _3 ; 
173181//      _1 = (const 1i32, move _11); 
174182//      StorageDead(_11); 
175183//      goto -> bb13; 
176184//  } 
177185//  bb12: { // binding3 and arm3 
178- //      StorageLive(_8 ); 
179- //      _8  = ((_2 as Some).0: i32); 
186+ //      StorageLive(_6 ); 
187+ //      _6  = ((_2 as Some).0: i32); 
180188//      StorageLive(_12); 
181- //      _12 = _8 ; 
189+ //      _12 = _6 ; 
182190//      _1 = (const 2i32, move _12); 
183191//      StorageDead(_12); 
184192//      goto -> bb13; 
@@ -193,81 +201,86 @@ fn main() {
193201// bb0: { 
194202//     ... 
195203//     _2 = std::option::Option<i32>::Some(const 1i32,); 
196- //     _3 = discriminant(_2); 
197- //     _4 = &_2; 
198- //     _13 = discriminant(_2); 
199- //     switchInt(move _13) -> [1isize: bb2, otherwise: bb3]; 
204+ //     FakeRead(ForMatchedPlace, _2); 
205+ //     _11 = discriminant(_2); 
206+ //    _16 = &shallow _2; 
207+ //    _17 = &((_2 as Some).0: i32); 
208+ //     switchInt(move _11) -> [1isize: bb2, otherwise: bb3]; 
200209// } 
201210// bb1: { 
202211//     resume; 
203212// } 
204213// bb2: { 
205- //     FakeRead(ForMatch, _4); 
214+ //      FakeRead(ForMatchGuard, _16); 
215+ //      FakeRead(ForMatchGuard, _17); 
206216//     falseEdges -> [real: bb7, imaginary: bb3]; //pre_binding1 
207217// } 
208218// bb3: { 
209- //     FakeRead(ForMatch, _4); 
219+ //      FakeRead(ForMatchGuard, _16); 
220+ //      FakeRead(ForMatchGuard, _17); 
210221//     falseEdges -> [real: bb11, imaginary: bb4]; //pre_binding2 
211222// } 
212223// bb4: { 
213- //     FakeRead(ForMatch, _4); 
224+ //      FakeRead(ForMatchGuard, _16); 
225+ //      FakeRead(ForMatchGuard, _17); 
214226//     falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding3 
215227// } 
216228// bb5: { 
217- //     FakeRead(ForMatch, _4); 
229+ //      FakeRead(ForMatchGuard, _16); 
230+ //      FakeRead(ForMatchGuard, _17); 
218231//     falseEdges -> [real: bb16, imaginary: bb6]; //pre_binding4 
219232// } 
220233// bb6: { 
221234//     unreachable; 
222235// } 
223236// bb7: { // binding1: Some(w) if guard() 
224- //     StorageLive(_7 ); 
225- //     _7  = &((_2 as Some).0: i32); 
226- //     StorageLive(_14 ); 
227- //     _14  = const guard() -> [return: bb8, unwind: bb1]; 
237+ //     StorageLive(_5 ); 
238+ //     _5  = &((_2 as Some).0: i32); 
239+ //     StorageLive(_12 ); 
240+ //     _12  = const guard() -> [return: bb8, unwind: bb1]; 
228241// } 
229242// bb8: { //end of guard 
230- //     switchInt(move _14 ) -> [false: bb9, otherwise: bb10]; 
243+ //     switchInt(move _12 ) -> [false: bb9, otherwise: bb10]; 
231244// } 
232245// bb9: { // to pre_binding2 
233246//     falseEdges -> [real: bb3, imaginary: bb3]; 
234247// } 
235248// bb10: { // set up bindings for arm1 
236- //     StorageLive(_5 ); 
237- //     _5  = ((_2 as Some).0: i32); 
249+ //     StorageLive(_3 ); 
250+ //     _3  = ((_2 as Some).0: i32); 
238251//     _1 = const 1i32; 
239252//     goto -> bb17; 
240253// } 
241254// bb11: { // binding2 & arm2 
242- //     StorageLive(_8 ); 
243- //     _8  = _2; 
255+ //     StorageLive(_6 ); 
256+ //     _6  = _2; 
244257//     _1 = const 2i32; 
245258//     goto -> bb17; 
246259// } 
247260// bb12: { // binding3: Some(y) if guard2(y) 
248- //     StorageLive(_11 ); 
249- //     _11  = &((_2 as Some).0: i32); 
250- //     StorageLive(_16 ); 
251- //     StorageLive(_17 ); 
252- //     _17  = (*_11 ); 
253- //     _16  = const guard2(move _17 ) -> [return: bb13, unwind: bb1]; 
261+ //     StorageLive(_9 ); 
262+ //     _9  = &((_2 as Some).0: i32); 
263+ //     StorageLive(_14 ); 
264+ //     StorageLive(_15 ); 
265+ //     _15  = (*_9 ); 
266+ //     _14  = const guard2(move _15 ) -> [return: bb13, unwind: bb1]; 
254267// } 
255268// bb13: { // end of guard2 
256- //     StorageDead(_17 ); 
257- //     switchInt(move _16 ) -> [false: bb14, otherwise: bb15]; 
269+ //     StorageDead(_15 ); 
270+ //     switchInt(move _14 ) -> [false: bb14, otherwise: bb15]; 
258271// } 
259272// bb14: { // to pre_binding4 
260273//     falseEdges -> [real: bb5, imaginary: bb5]; 
261274// } 
262275// bb15: { // set up bindings for arm3 
263- //     StorageLive(_9 ); 
264- //     _9  = ((_2 as Some).0: i32); 
276+ //     StorageLive(_7 ); 
277+ //     _7  = ((_2 as Some).0: i32); 
265278//     _1 = const 3i32; 
266279//     goto -> bb17; 
267280// } 
268281// bb16: { // binding4 & arm4 
269- //     StorageLive(_12 ); 
270- //     _12  = _2; 
282+ //     StorageLive(_10 ); 
283+ //     _10  = _2; 
271284//     _1 = const 4i32; 
272285//     goto -> bb17; 
273286// } 
0 commit comments