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