| - // MIR for `run2::{closure#0}` before Inline |
| + // MIR for `run2::{closure#0}` after Inline |
| |
| fn run2::{closure#0}(_1: {closure@$DIR/inline_coroutine_body.rs:13:9: 13:11}) -> () { |
| debug permit => (_1.0: ActionPermit<'_, T>); |
| debug ctx => (*(_1.1: &mut std::task::Context<'_>)); |
| let mut _0: (); |
| let mut _2: {async fn body of ActionPermit<'_, T>::perform()}; |
| let mut _3: ActionPermit<'_, T>; |
| let mut _5: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| let _6: (); |
| let mut _7: std::task::Poll<()>; |
| let mut _8: std::pin::Pin<&mut {async fn body of ActionPermit<'_, T>::perform()}>; |
| let mut _9: &mut std::task::Context<'_>; |
| let mut _10: &mut std::task::Context<'_>; |
| scope 1 { |
| debug fut => _2; |
| let _4: std::pin::Pin<&mut {async fn body of ActionPermit<'_, T>::perform()}>; |
| scope 2 { |
| debug fut => _4; |
| scope 3 { |
| } |
| + scope 6 (inlined ActionPermit::<'_, T>::perform::{closure#0}) { |
| + let _11: ActionPermit<'_, T>; |
| + let mut _12: std::future::Ready<()>; |
| + let mut _13: std::future::Ready<()>; |
| + let mut _14: (); |
| + let mut _16: (); |
| + let _17: (); |
| + let mut _18: std::task::Poll<()>; |
| + let mut _19: std::pin::Pin<&mut std::future::Ready<()>>; |
| + let mut _20: &mut std::future::Ready<()>; |
| + let mut _21: &mut std::future::Ready<()>; |
| + let mut _22: &mut std::task::Context<'_>; |
| + let mut _23: &mut std::task::Context<'_>; |
| + let mut _24: &mut std::task::Context<'_>; |
| + let mut _25: isize; |
| + let mut _27: !; |
| + let mut _28: &mut std::task::Context<'_>; |
| + let mut _29: (); |
| + let mut _30: (); |
| + let mut _31: &mut std::task::Context<'_>; |
| + let mut _32: u32; |
| + let mut _33: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _34: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _35: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _36: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _37: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _38: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _39: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _40: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _41: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + let mut _42: &mut {async fn body of ActionPermit<'_, T>::perform()}; |
| + scope 7 { |
| + let mut _15: std::future::Ready<()>; |
| + scope 8 { |
| + let _26: (); |
| + scope 9 { |
| + } |
| + scope 12 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) { |
| + } |
| + scope 13 (inlined <std::future::Ready<()> as Future>::poll) { |
| + let mut _44: (); |
| + let mut _45: std::option::Option<()>; |
| + let mut _46: &mut std::option::Option<()>; |
| + let mut _47: &mut std::future::Ready<()>; |
| + let mut _48: &mut std::pin::Pin<&mut std::future::Ready<()>>; |
| + scope 14 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) { |
| + scope 15 (inlined Pin::<&mut std::future::Ready<()>>::as_mut) { |
| + let mut _49: &mut &mut std::future::Ready<()>; |
| + scope 16 (inlined Pin::<&mut std::future::Ready<()>>::new_unchecked) { |
| + } |
| + scope 18 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) { |
| + } |
| + } |
| + scope 17 (inlined Pin::<&mut std::future::Ready<()>>::get_mut) { |
| + } |
| + } |
| + scope 19 (inlined Option::<()>::take) { |
| + let mut _50: std::option::Option<()>; |
| + scope 20 (inlined std::mem::replace::<Option<()>>) { |
| + scope 21 { |
| + } |
| + } |
| + } |
| + scope 22 (inlined #[track_caller] Option::<()>::expect) { |
| + let mut _51: isize; |
| + let mut _52: !; |
| + scope 23 { |
| + } |
| + } |
| + } |
| + } |
| + scope 10 (inlined ready::<()>) { |
| + let mut _43: std::option::Option<()>; |
| + } |
| + scope 11 (inlined <std::future::Ready<()> as IntoFuture>::into_future) { |
| + } |
| + } |
| + } |
| } |
| + scope 5 (inlined Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked) { |
| + } |
| } |
| + scope 4 (inlined ActionPermit::<'_, T>::perform) { |
| + } |
| |
| bb0: { |
| StorageLive(_2); |
| StorageLive(_3); |
| _3 = move (_1.0: ActionPermit<'_, T>); |
| - _2 = ActionPermit::<'_, T>::perform(move _3) -> [return: bb1, unwind: bb6]; |
| - } |
| - |
| - bb1: { |
| + _2 = {coroutine@$DIR/inline_coroutine_body.rs:25:28: 27:6 (#0)} { self: move _3 }; |
| StorageDead(_3); |
| StorageLive(_4); |
| StorageLive(_5); |
| _5 = &mut _2; |
| - _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}>::new_unchecked(move _5) -> [return: bb2, unwind: bb5]; |
| - } |
| - |
| - bb2: { |
| + _4 = Pin::<&mut {async fn body of ActionPermit<'_, T>::perform()}> { pointer: copy _5 }; |
| StorageDead(_5); |
| StorageLive(_6); |
| StorageLive(_7); |
| StorageLive(_8); |
| _8 = move _4; |
| StorageLive(_9); |
| _10 = deref_copy (_1.1: &mut std::task::Context<'_>); |
| _9 = &mut (*_10); |
| - _7 = <{async fn body of ActionPermit<'_, T>::perform()} as Future>::poll(move _8, move _9) -> [return: bb3, unwind: bb5]; |
| + StorageLive(_11); |
| + StorageLive(_15); |
| + StorageLive(_16); |
| + StorageLive(_25); |
| + StorageLive(_27); |
| + StorageLive(_30); |
| + StorageLive(_31); |
| + StorageLive(_32); |
| + StorageLive(_33); |
| + StorageLive(_34); |
| + StorageLive(_35); |
| + StorageLive(_36); |
| + StorageLive(_37); |
| + StorageLive(_38); |
| + StorageLive(_39); |
| + StorageLive(_40); |
| + StorageLive(_41); |
| + StorageLive(_42); |
| + _33 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + _32 = discriminant((*_33)); |
| + switchInt(move _32) -> [0: bb5, 1: bb15, 2: bb14, 3: bb13, otherwise: bb7]; |
| } |
| |
| - bb3: { |
| + bb1: { |
| + StorageDead(_2); |
| + return; |
| + } |
| + |
| + bb2 (cleanup): { |
| + drop(_2) -> [return: bb3, unwind terminate(cleanup)]; |
| + } |
| + |
| + bb3 (cleanup): { |
| + resume; |
| + } |
| + |
| + bb4: { |
| + StorageDead(_42); |
| + StorageDead(_41); |
| + StorageDead(_40); |
| + StorageDead(_39); |
| + StorageDead(_38); |
| + StorageDead(_37); |
| + StorageDead(_36); |
| + StorageDead(_35); |
| + StorageDead(_34); |
| + StorageDead(_33); |
| + StorageDead(_32); |
| + StorageDead(_31); |
| + StorageDead(_30); |
| + StorageDead(_27); |
| + StorageDead(_25); |
| + StorageDead(_16); |
| + StorageDead(_15); |
| + StorageDead(_11); |
| StorageDead(_9); |
| StorageDead(_8); |
| StorageDead(_7); |
| _6 = const (); |
| StorageDead(_6); |
| _0 = const (); |
| StorageDead(_4); |
| - drop(_2) -> [return: bb4, unwind: bb6]; |
| + drop(_2) -> [return: bb1, unwind: bb3]; |
| } |
| |
| - bb4: { |
| - StorageDead(_2); |
| - return; |
| + bb5: { |
| + _31 = move _9; |
| + _34 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + _35 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + (((*_34) as variant#3).0: ActionPermit<'_, T>) = move ((*_35).0: ActionPermit<'_, T>); |
| + StorageLive(_12); |
| + StorageLive(_13); |
| + StorageLive(_14); |
| + _14 = (); |
| + StorageLive(_43); |
| + _43 = Option::<()>::Some(copy _14); |
| + _13 = std::future::Ready::<()>(move _43); |
| + StorageDead(_43); |
| + StorageDead(_14); |
| + _12 = move _13; |
| + StorageDead(_13); |
| + _36 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + (((*_36) as variant#3).1: std::future::Ready<()>) = move _12; |
| + goto -> bb6; |
| } |
| |
| - bb5 (cleanup): { |
| - drop(_2) -> [return: bb6, unwind terminate(cleanup)]; |
| + bb6: { |
| + StorageLive(_17); |
| + StorageLive(_18); |
| + StorageLive(_19); |
| + StorageLive(_20); |
| + StorageLive(_21); |
| + _37 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + _21 = &mut (((*_37) as variant#3).1: std::future::Ready<()>); |
| + _20 = &mut (*_21); |
| + _19 = Pin::<&mut std::future::Ready<()>> { pointer: copy _20 }; |
| + StorageDead(_20); |
| + StorageLive(_22); |
| + StorageLive(_23); |
| + StorageLive(_24); |
| + _24 = copy _31; |
| + _23 = move _24; |
| + _22 = &mut (*_23); |
| + StorageDead(_24); |
| + StorageLive(_47); |
| + StorageLive(_48); |
| + StorageLive(_52); |
| + StorageLive(_44); |
| + StorageLive(_45); |
| + StorageLive(_46); |
| + _48 = &mut _19; |
| + StorageLive(_49); |
| + _49 = &mut (_19.0: &mut std::future::Ready<()>); |
| + _47 = copy (_19.0: &mut std::future::Ready<()>); |
| + StorageDead(_49); |
| + _46 = &mut ((*_47).0: std::option::Option<()>); |
| + StorageLive(_50); |
| + _50 = Option::<()>::None; |
| + _45 = copy ((*_47).0: std::option::Option<()>); |
| + ((*_47).0: std::option::Option<()>) = copy _50; |
| + StorageDead(_50); |
| + StorageDead(_46); |
| + StorageLive(_51); |
| + _51 = discriminant(_45); |
| + switchInt(move _51) -> [0: bb16, 1: bb17, otherwise: bb7]; |
| } |
| |
| - bb6 (cleanup): { |
| - resume; |
| + bb7: { |
| + unreachable; |
| } |
| + |
| + bb8: { |
| + _17 = const (); |
| + StorageDead(_23); |
| + StorageDead(_21); |
| + StorageDead(_18); |
| + StorageDead(_17); |
| + StorageLive(_28); |
| + StorageLive(_29); |
| + _29 = (); |
| + _7 = Poll::<()>::Pending; |
| + StorageDead(_12); |
| + StorageDead(_28); |
| + StorageDead(_29); |
| + _38 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + discriminant((*_38)) = 3; |
| + goto -> bb4; |
| + } |
| + |
| + bb9: { |
| + StorageLive(_26); |
| + _26 = copy ((_18 as Ready).0: ()); |
| + _30 = copy _26; |
| + StorageDead(_26); |
| + StorageDead(_23); |
| + StorageDead(_21); |
| + StorageDead(_18); |
| + StorageDead(_17); |
| + StorageDead(_12); |
| + _39 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + drop((((*_39) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb10, unwind: bb12]; |
| + } |
| + |
| + bb10: { |
| + _7 = Poll::<()>::Ready(move _30); |
| + _40 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + discriminant((*_40)) = 1; |
| + goto -> bb4; |
| + } |
| + |
| + bb11 (cleanup): { |
| + StorageDead(_22); |
| + StorageDead(_19); |
| + StorageDead(_23); |
| + StorageDead(_21); |
| + StorageDead(_18); |
| + StorageDead(_17); |
| + StorageDead(_12); |
| + _41 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + drop((((*_41) as variant#3).0: ActionPermit<'_, T>)) -> [return: bb12, unwind terminate(cleanup)]; |
| + } |
| + |
| + bb12 (cleanup): { |
| + _42 = deref_copy (_8.0: &mut {async fn body of ActionPermit<'_, T>::perform()}); |
| + discriminant((*_42)) = 2; |
| + goto -> bb2; |
| + } |
| + |
| + bb13: { |
| + StorageLive(_12); |
| + StorageLive(_28); |
| + StorageLive(_29); |
| + _28 = move _9; |
| + StorageDead(_29); |
| + _31 = move _28; |
| + StorageDead(_28); |
| + _16 = const (); |
| + goto -> bb6; |
| + } |
| + |
| + bb14: { |
| + assert(const false, "`async fn` resumed after panicking") -> [success: bb14, unwind: bb2]; |
| + } |
| + |
| + bb15: { |
| + assert(const false, "`async fn` resumed after completion") -> [success: bb15, unwind: bb2]; |
| + } |
| + |
| + bb16: { |
| + _52 = option::expect_failed(const "`Ready` polled after completion") -> bb11; |
| + } |
| + |
| + bb17: { |
| + _44 = move ((_45 as Some).0: ()); |
| + StorageDead(_51); |
| + StorageDead(_45); |
| + _18 = Poll::<()>::Ready(move _44); |
| + StorageDead(_44); |
| + StorageDead(_52); |
| + StorageDead(_48); |
| + StorageDead(_47); |
| + StorageDead(_22); |
| + StorageDead(_19); |
| + _25 = discriminant(_18); |
| + switchInt(move _25) -> [0: bb9, 1: bb8, otherwise: bb7]; |
| + } |
| + } |
| + |
| + ALLOC0 (size: 31, align: 1) { |
| + 0x00 │ 60 52 65 61 64 79 60 20 70 6f 6c 6c 65 64 20 61 │ `Ready` polled a |
| + 0x10 │ 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6f 6e │ fter completion |
| } |
| |