|
| 1 | +- // MIR for `run2::{closure#0}` before Inline |
| 2 | ++ // MIR for `run2::{closure#0}` after Inline |
| 3 | + |
| 4 | + fn run2::{closure#0}(_1: {closure@$DIR/inline_coroutine_body.rs:13:9: 13:11}) -> () { |
| 5 | + debug permit => (_1.0: ActionPermit<'_, T>); |
| 6 | + debug ctx => (*(_1.1: &mut std::task::Context<'_>)); |
| 7 | + let mut _0: (); |
| 8 | + let mut _2: {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 9 | + let mut _3: ActionPermit<'_, T>; |
| 10 | + let mut _5: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 11 | + let _6: (); |
| 12 | + let mut _7: std::task::Poll<()>; |
| 13 | + let mut _8: std::pin::Pin<&mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}>; |
| 14 | + let mut _9: &mut std::task::Context<'_>; |
| 15 | + let mut _10: &mut std::task::Context<'_>; |
| 16 | + scope 1 { |
| 17 | + debug fut => _2; |
| 18 | + let _4: std::pin::Pin<&mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}>; |
| 19 | + scope 2 { |
| 20 | + debug fut => _4; |
| 21 | + scope 4 { |
| 22 | + } |
| 23 | ++ scope 7 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { |
| 24 | ++ debug _task_context => _31; |
| 25 | ++ debug self => ((*(_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6})).0: ActionPermit<'_, T>); |
| 26 | ++ let _11: ActionPermit<'_, T>; |
| 27 | ++ let mut _12: std::future::Ready<()>; |
| 28 | ++ let mut _13: std::future::Ready<()>; |
| 29 | ++ let mut _14: (); |
| 30 | ++ let mut _16: (); |
| 31 | ++ let _17: (); |
| 32 | ++ let mut _18: std::task::Poll<()>; |
| 33 | ++ let mut _19: std::pin::Pin<&mut std::future::Ready<()>>; |
| 34 | ++ let mut _20: &mut std::future::Ready<()>; |
| 35 | ++ let mut _21: &mut std::future::Ready<()>; |
| 36 | ++ let mut _22: &mut std::task::Context<'_>; |
| 37 | ++ let mut _23: &mut std::task::Context<'_>; |
| 38 | ++ let mut _24: &mut std::task::Context<'_>; |
| 39 | ++ let mut _25: isize; |
| 40 | ++ let mut _27: !; |
| 41 | ++ let mut _28: &mut std::task::Context<'_>; |
| 42 | ++ let mut _29: (); |
| 43 | ++ let mut _30: (); |
| 44 | ++ let mut _31: &mut std::task::Context<'_>; |
| 45 | ++ let mut _32: u32; |
| 46 | ++ let mut _33: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 47 | ++ let mut _34: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 48 | ++ let mut _35: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 49 | ++ let mut _36: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 50 | ++ let mut _37: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 51 | ++ let mut _38: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 52 | ++ let mut _39: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 53 | ++ let mut _40: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 54 | ++ let mut _41: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 55 | ++ let mut _42: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}; |
| 56 | ++ scope 8 { |
| 57 | ++ debug self => (((*(_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6})) as variant#3).0: ActionPermit<'_, T>); |
| 58 | ++ let mut _15: std::future::Ready<()>; |
| 59 | ++ scope 9 { |
| 60 | ++ debug __awaitee => (((*(_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6})) as variant#3).1: std::future::Ready<()>); |
| 61 | ++ let _26: (); |
| 62 | ++ scope 10 { |
| 63 | ++ } |
| 64 | ++ scope 11 { |
| 65 | ++ debug result => _26; |
| 66 | ++ } |
| 67 | ++ } |
| 68 | ++ scope 12 (inlined ready::<()>) { |
| 69 | ++ debug t => _14; |
| 70 | ++ let mut _43: std::option::Option<()>; |
| 71 | ++ } |
| 72 | ++ } |
| 73 | ++ } |
| 74 | + } |
| 75 | + scope 3 { |
| 76 | ++ scope 6 (inlined Pin::<&mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}>::new_unchecked) { |
| 77 | ++ debug pointer => _5; |
| 78 | ++ } |
| 79 | + } |
| 80 | + } |
| 81 | ++ scope 5 (inlined ActionPermit::<'_, T>::perform) { |
| 82 | ++ debug self => _3; |
| 83 | ++ } |
| 84 | + |
| 85 | + bb0: { |
| 86 | + StorageLive(_2); |
| 87 | + StorageLive(_3); |
| 88 | + _3 = move (_1.0: ActionPermit<'_, T>); |
| 89 | +- _2 = ActionPermit::<'_, T>::perform(move _3) -> [return: bb1, unwind: bb6]; |
| 90 | +- } |
| 91 | +- |
| 92 | +- bb1: { |
| 93 | ++ _2 = {coroutine@$DIR/inline_coroutine_body.rs:25:28: 27:6 (#0)} { self: move _3 }; |
| 94 | + StorageDead(_3); |
| 95 | + StorageLive(_4); |
| 96 | + StorageLive(_5); |
| 97 | + _5 = &mut _2; |
| 98 | +- _4 = Pin::<&mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}>::new_unchecked(move _5) -> [return: bb2, unwind: bb5]; |
| 99 | +- } |
| 100 | +- |
| 101 | +- bb2: { |
| 102 | ++ _4 = Pin::<&mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}> { __pointer: _5 }; |
| 103 | + StorageDead(_5); |
| 104 | + StorageLive(_6); |
| 105 | + StorageLive(_7); |
| 106 | + StorageLive(_8); |
| 107 | + _8 = move _4; |
| 108 | + StorageLive(_9); |
| 109 | + _10 = deref_copy (_1.1: &mut std::task::Context<'_>); |
| 110 | + _9 = &mut (*_10); |
| 111 | +- _7 = <{async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6} as Future>::poll(move _8, move _9) -> [return: bb3, unwind: bb5]; |
| 112 | ++ StorageLive(_11); |
| 113 | ++ StorageLive(_15); |
| 114 | ++ StorageLive(_16); |
| 115 | ++ StorageLive(_25); |
| 116 | ++ StorageLive(_27); |
| 117 | ++ StorageLive(_30); |
| 118 | ++ StorageLive(_31); |
| 119 | ++ StorageLive(_32); |
| 120 | ++ StorageLive(_33); |
| 121 | ++ StorageLive(_34); |
| 122 | ++ StorageLive(_35); |
| 123 | ++ StorageLive(_36); |
| 124 | ++ StorageLive(_37); |
| 125 | ++ StorageLive(_38); |
| 126 | ++ StorageLive(_39); |
| 127 | ++ StorageLive(_40); |
| 128 | ++ StorageLive(_41); |
| 129 | ++ StorageLive(_42); |
| 130 | ++ _33 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 131 | ++ _32 = discriminant((*_33)); |
| 132 | ++ switchInt(move _32) -> [0: bb5, 1: bb22, 2: bb21, 3: bb20, otherwise: bb10]; |
| 133 | + } |
| 134 | + |
| 135 | +- bb3: { |
| 136 | ++ bb1: { |
| 137 | ++ StorageDead(_2); |
| 138 | ++ return; |
| 139 | ++ } |
| 140 | ++ |
| 141 | ++ bb2 (cleanup): { |
| 142 | ++ drop(_2) -> [return: bb3, unwind terminate(cleanup)]; |
| 143 | ++ } |
| 144 | ++ |
| 145 | ++ bb3 (cleanup): { |
| 146 | ++ resume; |
| 147 | ++ } |
| 148 | ++ |
| 149 | ++ bb4: { |
| 150 | ++ StorageDead(_42); |
| 151 | ++ StorageDead(_41); |
| 152 | ++ StorageDead(_40); |
| 153 | ++ StorageDead(_39); |
| 154 | ++ StorageDead(_38); |
| 155 | ++ StorageDead(_37); |
| 156 | ++ StorageDead(_36); |
| 157 | ++ StorageDead(_35); |
| 158 | ++ StorageDead(_34); |
| 159 | ++ StorageDead(_33); |
| 160 | ++ StorageDead(_32); |
| 161 | ++ StorageDead(_31); |
| 162 | ++ StorageDead(_30); |
| 163 | ++ StorageDead(_27); |
| 164 | ++ StorageDead(_25); |
| 165 | ++ StorageDead(_16); |
| 166 | ++ StorageDead(_15); |
| 167 | ++ StorageDead(_11); |
| 168 | + StorageDead(_9); |
| 169 | + StorageDead(_8); |
| 170 | + StorageDead(_7); |
| 171 | + _6 = const (); |
| 172 | + StorageDead(_6); |
| 173 | + _0 = const (); |
| 174 | + StorageDead(_4); |
| 175 | +- drop(_2) -> [return: bb4, unwind: bb6]; |
| 176 | ++ drop(_2) -> [return: bb1, unwind: bb3]; |
| 177 | + } |
| 178 | + |
| 179 | +- bb4: { |
| 180 | +- StorageDead(_2); |
| 181 | +- return; |
| 182 | ++ bb5: { |
| 183 | ++ _31 = move _9; |
| 184 | ++ _34 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 185 | ++ _35 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 186 | ++ (((*_34) as variant#3).0: ActionPermit<'_, T>) = move ((*_35).0: ActionPermit<'_, T>); |
| 187 | ++ StorageLive(_12); |
| 188 | ++ StorageLive(_13); |
| 189 | ++ StorageLive(_14); |
| 190 | ++ _14 = (); |
| 191 | ++ StorageLive(_43); |
| 192 | ++ _43 = Option::<()>::Some(_14); |
| 193 | ++ _13 = std::future::Ready::<()>(move _43); |
| 194 | ++ StorageDead(_43); |
| 195 | ++ StorageDead(_14); |
| 196 | ++ _12 = <std::future::Ready<()> as IntoFuture>::into_future(move _13) -> [return: bb6, unwind: bb17]; |
| 197 | + } |
| 198 | + |
| 199 | +- bb5 (cleanup): { |
| 200 | +- drop(_2) -> [return: bb6, unwind terminate(cleanup)]; |
| 201 | ++ bb6: { |
| 202 | ++ StorageDead(_13); |
| 203 | ++ _36 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 204 | ++ (((*_36) as variant#3).1: std::future::Ready<()>) = move _12; |
| 205 | ++ goto -> bb7; |
| 206 | + } |
| 207 | + |
| 208 | +- bb6 (cleanup): { |
| 209 | +- resume; |
| 210 | ++ bb7: { |
| 211 | ++ StorageLive(_17); |
| 212 | ++ StorageLive(_18); |
| 213 | ++ StorageLive(_19); |
| 214 | ++ StorageLive(_20); |
| 215 | ++ StorageLive(_21); |
| 216 | ++ _37 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 217 | ++ _21 = &mut (((*_37) as variant#3).1: std::future::Ready<()>); |
| 218 | ++ _20 = &mut (*_21); |
| 219 | ++ _19 = Pin::<&mut std::future::Ready<()>>::new_unchecked(move _20) -> [return: bb8, unwind: bb15]; |
| 220 | ++ } |
| 221 | ++ |
| 222 | ++ bb8: { |
| 223 | ++ StorageDead(_20); |
| 224 | ++ StorageLive(_22); |
| 225 | ++ StorageLive(_23); |
| 226 | ++ StorageLive(_24); |
| 227 | ++ _24 = _31; |
| 228 | ++ _23 = move _24; |
| 229 | ++ _22 = &mut (*_23); |
| 230 | ++ StorageDead(_24); |
| 231 | ++ _18 = <std::future::Ready<()> as Future>::poll(move _19, move _22) -> [return: bb9, unwind: bb14]; |
| 232 | ++ } |
| 233 | ++ |
| 234 | ++ bb9: { |
| 235 | ++ StorageDead(_22); |
| 236 | ++ StorageDead(_19); |
| 237 | ++ _25 = discriminant(_18); |
| 238 | ++ switchInt(move _25) -> [0: bb12, 1: bb11, otherwise: bb10]; |
| 239 | ++ } |
| 240 | ++ |
| 241 | ++ bb10: { |
| 242 | ++ unreachable; |
| 243 | ++ } |
| 244 | ++ |
| 245 | ++ bb11: { |
| 246 | ++ _17 = const (); |
| 247 | ++ StorageDead(_23); |
| 248 | ++ StorageDead(_21); |
| 249 | ++ StorageDead(_18); |
| 250 | ++ StorageDead(_17); |
| 251 | ++ StorageLive(_28); |
| 252 | ++ StorageLive(_29); |
| 253 | ++ _29 = (); |
| 254 | ++ _7 = Poll::<()>::Pending; |
| 255 | ++ StorageDead(_12); |
| 256 | ++ StorageDead(_28); |
| 257 | ++ StorageDead(_29); |
| 258 | ++ _38 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 259 | ++ discriminant((*_38)) = 3; |
| 260 | ++ goto -> bb4; |
| 261 | ++ } |
| 262 | ++ |
| 263 | ++ bb12: { |
| 264 | ++ StorageLive(_26); |
| 265 | ++ _26 = ((_18 as Ready).0: ()); |
| 266 | ++ _30 = _26; |
| 267 | ++ StorageDead(_26); |
| 268 | ++ StorageDead(_23); |
| 269 | ++ StorageDead(_21); |
| 270 | ++ StorageDead(_18); |
| 271 | ++ StorageDead(_17); |
| 272 | ++ StorageDead(_12); |
| 273 | ++ _39 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 274 | ++ drop((((*_39) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb13, unwind: bb19]; |
| 275 | ++ } |
| 276 | ++ |
| 277 | ++ bb13: { |
| 278 | ++ _7 = Poll::<()>::Ready(move _30); |
| 279 | ++ _40 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 280 | ++ discriminant((*_40)) = 1; |
| 281 | ++ goto -> bb4; |
| 282 | ++ } |
| 283 | ++ |
| 284 | ++ bb14 (cleanup): { |
| 285 | ++ StorageDead(_22); |
| 286 | ++ StorageDead(_19); |
| 287 | ++ StorageDead(_23); |
| 288 | ++ goto -> bb16; |
| 289 | ++ } |
| 290 | ++ |
| 291 | ++ bb15 (cleanup): { |
| 292 | ++ StorageDead(_20); |
| 293 | ++ StorageDead(_19); |
| 294 | ++ goto -> bb16; |
| 295 | ++ } |
| 296 | ++ |
| 297 | ++ bb16 (cleanup): { |
| 298 | ++ StorageDead(_21); |
| 299 | ++ StorageDead(_18); |
| 300 | ++ StorageDead(_17); |
| 301 | ++ goto -> bb18; |
| 302 | ++ } |
| 303 | ++ |
| 304 | ++ bb17 (cleanup): { |
| 305 | ++ StorageDead(_13); |
| 306 | ++ goto -> bb18; |
| 307 | ++ } |
| 308 | ++ |
| 309 | ++ bb18 (cleanup): { |
| 310 | ++ StorageDead(_12); |
| 311 | ++ _41 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 312 | ++ drop((((*_41) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb19, unwind terminate(cleanup)]; |
| 313 | ++ } |
| 314 | ++ |
| 315 | ++ bb19 (cleanup): { |
| 316 | ++ _42 = deref_copy (_8.0: &mut {async fn body@$DIR/inline_coroutine_body.rs:25:28: 27:6}); |
| 317 | ++ discriminant((*_42)) = 2; |
| 318 | ++ goto -> bb2; |
| 319 | ++ } |
| 320 | ++ |
| 321 | ++ bb20: { |
| 322 | ++ StorageLive(_12); |
| 323 | ++ StorageLive(_28); |
| 324 | ++ StorageLive(_29); |
| 325 | ++ _28 = move _9; |
| 326 | ++ StorageDead(_29); |
| 327 | ++ _31 = move _28; |
| 328 | ++ StorageDead(_28); |
| 329 | ++ _16 = const (); |
| 330 | ++ goto -> bb7; |
| 331 | ++ } |
| 332 | ++ |
| 333 | ++ bb21: { |
| 334 | ++ assert(const false, "`async fn` resumed after panicking") -> [success: bb21, unwind: bb2]; |
| 335 | ++ } |
| 336 | ++ |
| 337 | ++ bb22: { |
| 338 | ++ assert(const false, "`async fn` resumed after completion") -> [success: bb22, unwind: bb2]; |
| 339 | + } |
| 340 | + } |
| 341 | + |
0 commit comments