]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
Rollup merge of #75837 - GuillaumeGomez:fix-font-color-help-button, r=Cldfire
[rust.git] / src / test / mir-opt / retag.main.SimplifyCfg-elaborate-drops.after.mir
1 // MIR for `main` after SimplifyCfg-elaborate-drops
2
3 fn main() -> () {
4     let mut _0: ();                      // return place in scope 0 at $DIR/retag.rs:29:11: 29:11
5     let mut _1: i32;                     // in scope 0 at $DIR/retag.rs:30:9: 30:14
6     let _2: ();                          // in scope 0 at $DIR/retag.rs:31:5: 37:6
7     let mut _4: &Test;                   // in scope 0 at $DIR/retag.rs:32:17: 32:24
8     let _5: Test;                        // in scope 0 at $DIR/retag.rs:32:17: 32:24
9     let mut _6: &mut i32;                // in scope 0 at $DIR/retag.rs:32:29: 32:35
10     let mut _7: &mut i32;                // in scope 0 at $DIR/retag.rs:32:29: 32:35
11     let mut _9: &mut i32;                // in scope 0 at $DIR/retag.rs:33:19: 33:20
12     let mut _12: *mut i32;               // in scope 0 at $DIR/retag.rs:36:18: 36:29
13     let mut _14: [closure@main::{{closure}}#0]; // in scope 0 at $DIR/retag.rs:40:31: 43:6
14     let mut _16: for<'r> fn(&'r i32) -> &'r i32; // in scope 0 at $DIR/retag.rs:44:14: 44:15
15     let mut _17: &i32;                   // in scope 0 at $DIR/retag.rs:44:16: 44:18
16     let _18: &i32;                       // in scope 0 at $DIR/retag.rs:44:16: 44:18
17     let _19: &i32;                       // in scope 0 at $DIR/retag.rs:47:5: 47:24
18     let mut _20: &Test;                  // in scope 0 at $DIR/retag.rs:47:5: 47:12
19     let _21: Test;                       // in scope 0 at $DIR/retag.rs:47:5: 47:12
20     let mut _22: &i32;                   // in scope 0 at $DIR/retag.rs:47:21: 47:23
21     let _23: &i32;                       // in scope 0 at $DIR/retag.rs:47:21: 47:23
22     let _24: i32;                        // in scope 0 at $DIR/retag.rs:47:22: 47:23
23     let mut _26: *const i32;             // in scope 0 at $DIR/retag.rs:50:14: 50:28
24     scope 1 {
25         debug x => _1;                   // in scope 1 at $DIR/retag.rs:30:9: 30:14
26         let _3: &mut i32;                // in scope 1 at $DIR/retag.rs:32:13: 32:14
27         let _13: for<'r> fn(&'r i32) -> &'r i32; // in scope 1 at $DIR/retag.rs:40:9: 40:10
28         scope 2 {
29             debug v => _3;               // in scope 2 at $DIR/retag.rs:32:13: 32:14
30             let _8: &mut i32;            // in scope 2 at $DIR/retag.rs:33:13: 33:14
31             scope 3 {
32                 debug w => _8;           // in scope 3 at $DIR/retag.rs:33:13: 33:14
33                 let _10: &mut i32;       // in scope 3 at $DIR/retag.rs:34:13: 34:14
34                 scope 4 {
35                     debug w => _10;      // in scope 4 at $DIR/retag.rs:34:13: 34:14
36                     let _11: *mut i32;   // in scope 4 at $DIR/retag.rs:36:13: 36:15
37                     scope 5 {
38                         debug _w => _11; // in scope 5 at $DIR/retag.rs:36:13: 36:15
39                     }
40                 }
41             }
42         }
43         scope 6 {
44             debug c => _13;              // in scope 6 at $DIR/retag.rs:40:9: 40:10
45             let _15: &i32;               // in scope 6 at $DIR/retag.rs:44:9: 44:11
46             scope 7 {
47                 debug _w => _15;         // in scope 7 at $DIR/retag.rs:44:9: 44:11
48                 let _25: *const i32;     // in scope 7 at $DIR/retag.rs:50:9: 50:11
49                 let mut _27: &i32;       // in scope 7 at $DIR/retag.rs:47:21: 47:23
50                 scope 8 {
51                     debug _w => _25;     // in scope 8 at $DIR/retag.rs:50:9: 50:11
52                 }
53             }
54         }
55     }
56
57     bb0: {
58         StorageLive(_1);                 // scope 0 at $DIR/retag.rs:30:9: 30:14
59         _1 = const 0_i32;                // scope 0 at $DIR/retag.rs:30:17: 30:18
60         StorageLive(_2);                 // scope 1 at $DIR/retag.rs:31:5: 37:6
61         StorageLive(_3);                 // scope 1 at $DIR/retag.rs:32:13: 32:14
62         StorageLive(_4);                 // scope 1 at $DIR/retag.rs:32:17: 32:24
63         StorageLive(_5);                 // scope 1 at $DIR/retag.rs:32:17: 32:24
64         _5 = Test(const 0_i32);          // scope 1 at $DIR/retag.rs:32:17: 32:24
65         _4 = &_5;                        // scope 1 at $DIR/retag.rs:32:17: 32:24
66         Retag(_4);                       // scope 1 at $DIR/retag.rs:32:17: 32:24
67         StorageLive(_6);                 // scope 1 at $DIR/retag.rs:32:29: 32:35
68         StorageLive(_7);                 // scope 1 at $DIR/retag.rs:32:29: 32:35
69         _7 = &mut _1;                    // scope 1 at $DIR/retag.rs:32:29: 32:35
70         Retag(_7);                       // scope 1 at $DIR/retag.rs:32:29: 32:35
71         _6 = &mut (*_7);                 // scope 1 at $DIR/retag.rs:32:29: 32:35
72         Retag([2phase] _6);              // scope 1 at $DIR/retag.rs:32:29: 32:35
73         _3 = Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/retag.rs:32:17: 32:36
74                                          // mir::Constant
75                                          // + span: $DIR/retag.rs:32:25: 32:28
76                                          // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(Scalar(<ZST>)) }
77     }
78
79     bb1 (cleanup): {
80         resume;                          // scope 0 at $DIR/retag.rs:29:1: 51:2
81     }
82
83     bb2: {
84         Retag(_3);                       // scope 1 at $DIR/retag.rs:32:17: 32:36
85         StorageDead(_6);                 // scope 1 at $DIR/retag.rs:32:35: 32:36
86         StorageDead(_4);                 // scope 1 at $DIR/retag.rs:32:35: 32:36
87         StorageDead(_7);                 // scope 1 at $DIR/retag.rs:32:36: 32:37
88         drop(_5) -> [return: bb4, unwind: bb1]; // scope 1 at $DIR/retag.rs:32:36: 32:37
89     }
90
91     bb3 (cleanup): {
92         drop(_5) -> bb1;                 // scope 1 at $DIR/retag.rs:32:36: 32:37
93     }
94
95     bb4: {
96         StorageDead(_5);                 // scope 1 at $DIR/retag.rs:32:36: 32:37
97         StorageLive(_8);                 // scope 2 at $DIR/retag.rs:33:13: 33:14
98         StorageLive(_9);                 // scope 2 at $DIR/retag.rs:33:19: 33:20
99         _9 = move _3;                    // scope 2 at $DIR/retag.rs:33:19: 33:20
100         Retag(_9);                       // scope 2 at $DIR/retag.rs:33:19: 33:20
101         _8 = &mut (*_9);                 // scope 2 at $DIR/retag.rs:33:19: 33:20
102         Retag(_8);                       // scope 2 at $DIR/retag.rs:33:19: 33:20
103         StorageDead(_9);                 // scope 2 at $DIR/retag.rs:33:22: 33:23
104         StorageLive(_10);                // scope 3 at $DIR/retag.rs:34:13: 34:14
105         _10 = move _8;                   // scope 3 at $DIR/retag.rs:34:17: 34:18
106         Retag(_10);                      // scope 3 at $DIR/retag.rs:34:17: 34:18
107         StorageLive(_11);                // scope 4 at $DIR/retag.rs:36:13: 36:15
108         StorageLive(_12);                // scope 4 at $DIR/retag.rs:36:18: 36:29
109         _12 = &raw mut (*_10);           // scope 4 at $DIR/retag.rs:36:18: 36:19
110         Retag([raw] _12);                // scope 4 at $DIR/retag.rs:36:18: 36:19
111         _11 = _12;                       // scope 4 at $DIR/retag.rs:36:18: 36:29
112         StorageDead(_12);                // scope 4 at $DIR/retag.rs:36:29: 36:30
113         _2 = const ();                   // scope 1 at $DIR/retag.rs:31:5: 37:6
114         StorageDead(_11);                // scope 4 at $DIR/retag.rs:37:5: 37:6
115         StorageDead(_10);                // scope 3 at $DIR/retag.rs:37:5: 37:6
116         StorageDead(_8);                 // scope 2 at $DIR/retag.rs:37:5: 37:6
117         StorageDead(_3);                 // scope 1 at $DIR/retag.rs:37:5: 37:6
118         StorageDead(_2);                 // scope 1 at $DIR/retag.rs:37:5: 37:6
119         StorageLive(_13);                // scope 1 at $DIR/retag.rs:40:9: 40:10
120         StorageLive(_14);                // scope 1 at $DIR/retag.rs:40:31: 43:6
121         _14 = [closure@main::{{closure}}#0]; // scope 1 at $DIR/retag.rs:40:31: 43:6
122                                          // closure
123                                          // + def_id: DefId(0:14 ~ retag[317d]::main[0]::{{closure}}[0])
124                                          // + substs: [
125                                          //     i8,
126                                          //     for<'r> extern "rust-call" fn((&'r i32,)) -> &'r i32,
127                                          //     (),
128                                          // ]
129         Retag(_14);                      // scope 1 at $DIR/retag.rs:40:31: 43:6
130         _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:40:31: 43:6
131         StorageDead(_14);                // scope 1 at $DIR/retag.rs:43:5: 43:6
132         StorageLive(_15);                // scope 6 at $DIR/retag.rs:44:9: 44:11
133         StorageLive(_16);                // scope 6 at $DIR/retag.rs:44:14: 44:15
134         _16 = _13;                       // scope 6 at $DIR/retag.rs:44:14: 44:15
135         StorageLive(_17);                // scope 6 at $DIR/retag.rs:44:16: 44:18
136         StorageLive(_18);                // scope 6 at $DIR/retag.rs:44:16: 44:18
137         _18 = &_1;                       // scope 6 at $DIR/retag.rs:44:16: 44:18
138         Retag(_18);                      // scope 6 at $DIR/retag.rs:44:16: 44:18
139         _17 = &(*_18);                   // scope 6 at $DIR/retag.rs:44:16: 44:18
140         Retag(_17);                      // scope 6 at $DIR/retag.rs:44:16: 44:18
141         _15 = move _16(move _17) -> bb5; // scope 6 at $DIR/retag.rs:44:14: 44:19
142     }
143
144     bb5: {
145         Retag(_15);                      // scope 6 at $DIR/retag.rs:44:14: 44:19
146         StorageDead(_17);                // scope 6 at $DIR/retag.rs:44:18: 44:19
147         StorageDead(_16);                // scope 6 at $DIR/retag.rs:44:18: 44:19
148         StorageDead(_18);                // scope 6 at $DIR/retag.rs:44:19: 44:20
149         StorageLive(_19);                // scope 7 at $DIR/retag.rs:47:5: 47:24
150         StorageLive(_20);                // scope 7 at $DIR/retag.rs:47:5: 47:12
151         StorageLive(_21);                // scope 7 at $DIR/retag.rs:47:5: 47:12
152         _21 = Test(const 0_i32);         // scope 7 at $DIR/retag.rs:47:5: 47:12
153         _20 = &_21;                      // scope 7 at $DIR/retag.rs:47:5: 47:12
154         Retag(_20);                      // scope 7 at $DIR/retag.rs:47:5: 47:12
155         StorageLive(_22);                // scope 7 at $DIR/retag.rs:47:21: 47:23
156         StorageLive(_23);                // scope 7 at $DIR/retag.rs:47:21: 47:23
157         _27 = const main::promoted[0];   // scope 7 at $DIR/retag.rs:47:21: 47:23
158                                          // ty::Const
159                                          // + ty: &i32
160                                          // + val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
161                                          // mir::Constant
162                                          // + span: $DIR/retag.rs:47:21: 47:23
163                                          // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:13 ~ retag[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
164         Retag(_27);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
165         _23 = &(*_27);                   // scope 7 at $DIR/retag.rs:47:21: 47:23
166         Retag(_23);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
167         _22 = &(*_23);                   // scope 7 at $DIR/retag.rs:47:21: 47:23
168         Retag(_22);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
169         _19 = Test::foo_shr(move _20, move _22) -> [return: bb6, unwind: bb7]; // scope 7 at $DIR/retag.rs:47:5: 47:24
170                                          // mir::Constant
171                                          // + span: $DIR/retag.rs:47:13: 47:20
172                                          // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(Scalar(<ZST>)) }
173     }
174
175     bb6: {
176         Retag(_19);                      // scope 7 at $DIR/retag.rs:47:5: 47:24
177         StorageDead(_22);                // scope 7 at $DIR/retag.rs:47:23: 47:24
178         StorageDead(_20);                // scope 7 at $DIR/retag.rs:47:23: 47:24
179         StorageDead(_23);                // scope 7 at $DIR/retag.rs:47:24: 47:25
180         drop(_21) -> [return: bb8, unwind: bb1]; // scope 7 at $DIR/retag.rs:47:24: 47:25
181     }
182
183     bb7 (cleanup): {
184         drop(_21) -> bb1;                // scope 7 at $DIR/retag.rs:47:24: 47:25
185     }
186
187     bb8: {
188         StorageDead(_21);                // scope 7 at $DIR/retag.rs:47:24: 47:25
189         StorageDead(_19);                // scope 7 at $DIR/retag.rs:47:24: 47:25
190         StorageLive(_25);                // scope 7 at $DIR/retag.rs:50:9: 50:11
191         StorageLive(_26);                // scope 7 at $DIR/retag.rs:50:14: 50:28
192         _26 = &raw const (*_15);         // scope 7 at $DIR/retag.rs:50:14: 50:16
193         Retag([raw] _26);                // scope 7 at $DIR/retag.rs:50:14: 50:16
194         _25 = _26;                       // scope 7 at $DIR/retag.rs:50:14: 50:28
195         StorageDead(_26);                // scope 7 at $DIR/retag.rs:50:28: 50:29
196         _0 = const ();                   // scope 0 at $DIR/retag.rs:29:11: 51:2
197         StorageDead(_25);                // scope 7 at $DIR/retag.rs:51:1: 51:2
198         StorageDead(_15);                // scope 6 at $DIR/retag.rs:51:1: 51:2
199         StorageDead(_13);                // scope 1 at $DIR/retag.rs:51:1: 51:2
200         StorageDead(_1);                 // scope 0 at $DIR/retag.rs:51:1: 51:2
201         return;                          // scope 0 at $DIR/retag.rs:51:2: 51:2
202     }
203 }