2023-10-19 16:46:28 -05:00
|
|
|
// MIR for `b::{closure#0}` 0 coroutine_resume
|
|
|
|
/* coroutine_layout = CoroutineLayout {
|
2022-12-20 08:15:29 -06:00
|
|
|
field_tys: {
|
2023-10-19 11:06:43 -05:00
|
|
|
_0: CoroutineSavedTy {
|
|
|
|
ty: Coroutine(
|
2024-08-23 20:44:52 -05:00
|
|
|
DefId(0:5 ~ async_await[ccf8]::a::{closure#0}),
|
2023-09-27 05:31:53 -05:00
|
|
|
[
|
2024-06-06 09:08:55 -05:00
|
|
|
(),
|
|
|
|
std::future::ResumeTy,
|
|
|
|
(),
|
|
|
|
(),
|
|
|
|
CoroutineWitness(
|
2024-08-23 20:44:52 -05:00
|
|
|
DefId(0:5 ~ async_await[ccf8]::a::{closure#0}),
|
2024-06-06 09:08:55 -05:00
|
|
|
[],
|
|
|
|
),
|
|
|
|
(),
|
2023-09-27 05:31:53 -05:00
|
|
|
],
|
2023-09-07 00:14:40 -05:00
|
|
|
),
|
2023-01-21 08:26:44 -06:00
|
|
|
source_info: SourceInfo {
|
2023-11-07 22:20:57 -06:00
|
|
|
span: $DIR/async_await.rs:16:5: 16:14 (#9),
|
2023-01-21 08:26:44 -06:00
|
|
|
scope: scope[0],
|
|
|
|
},
|
|
|
|
ignore_for_traits: false,
|
|
|
|
},
|
2023-10-19 11:06:43 -05:00
|
|
|
_1: CoroutineSavedTy {
|
|
|
|
ty: Coroutine(
|
2024-08-23 20:44:52 -05:00
|
|
|
DefId(0:5 ~ async_await[ccf8]::a::{closure#0}),
|
2023-09-27 05:31:53 -05:00
|
|
|
[
|
2024-06-06 09:08:55 -05:00
|
|
|
(),
|
|
|
|
std::future::ResumeTy,
|
|
|
|
(),
|
|
|
|
(),
|
|
|
|
CoroutineWitness(
|
2024-08-23 20:44:52 -05:00
|
|
|
DefId(0:5 ~ async_await[ccf8]::a::{closure#0}),
|
2024-06-06 09:08:55 -05:00
|
|
|
[],
|
|
|
|
),
|
|
|
|
(),
|
2023-09-27 05:31:53 -05:00
|
|
|
],
|
2023-09-07 00:14:40 -05:00
|
|
|
),
|
2023-01-21 08:26:44 -06:00
|
|
|
source_info: SourceInfo {
|
2023-11-07 22:20:57 -06:00
|
|
|
span: $DIR/async_await.rs:17:5: 17:14 (#11),
|
2023-01-21 08:26:44 -06:00
|
|
|
scope: scope[0],
|
|
|
|
},
|
|
|
|
ignore_for_traits: false,
|
|
|
|
},
|
2022-12-20 08:15:29 -06:00
|
|
|
},
|
|
|
|
variant_fields: {
|
|
|
|
Unresumed(0): [],
|
|
|
|
Returned (1): [],
|
|
|
|
Panicked (2): [],
|
|
|
|
Suspend0 (3): [_0],
|
|
|
|
Suspend1 (4): [_1],
|
|
|
|
},
|
|
|
|
storage_conflicts: BitMatrix(2x2) {
|
|
|
|
(_0, _0),
|
|
|
|
(_1, _1),
|
|
|
|
},
|
|
|
|
} */
|
|
|
|
|
2024-03-22 19:43:53 -05:00
|
|
|
fn b::{closure#0}(_1: Pin<&mut {async fn body of b()}>, _2: &mut Context<'_>) -> Poll<()> {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug _task_context => _38;
|
|
|
|
let mut _0: std::task::Poll<()>;
|
|
|
|
let _3: ();
|
2024-03-22 19:43:53 -05:00
|
|
|
let mut _4: {async fn body of a()};
|
|
|
|
let mut _5: {async fn body of a()};
|
|
|
|
let mut _6: {async fn body of a()};
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _7: ();
|
|
|
|
let _8: ();
|
|
|
|
let mut _9: std::task::Poll<()>;
|
2024-03-22 19:43:53 -05:00
|
|
|
let mut _10: std::pin::Pin<&mut {async fn body of a()}>;
|
|
|
|
let mut _11: &mut {async fn body of a()};
|
|
|
|
let mut _12: &mut {async fn body of a()};
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _13: &mut std::task::Context<'_>;
|
|
|
|
let mut _14: &mut std::task::Context<'_>;
|
|
|
|
let mut _15: &mut std::task::Context<'_>;
|
|
|
|
let mut _16: isize;
|
|
|
|
let mut _18: !;
|
|
|
|
let mut _19: &mut std::task::Context<'_>;
|
|
|
|
let mut _20: ();
|
2024-03-22 19:43:53 -05:00
|
|
|
let mut _21: {async fn body of a()};
|
|
|
|
let mut _22: {async fn body of a()};
|
|
|
|
let mut _23: {async fn body of a()};
|
2023-06-06 08:47:00 -05:00
|
|
|
let _24: ();
|
|
|
|
let mut _25: std::task::Poll<()>;
|
2024-03-22 19:43:53 -05:00
|
|
|
let mut _26: std::pin::Pin<&mut {async fn body of a()}>;
|
|
|
|
let mut _27: &mut {async fn body of a()};
|
|
|
|
let mut _28: &mut {async fn body of a()};
|
2023-06-06 08:47:00 -05:00
|
|
|
let mut _29: &mut std::task::Context<'_>;
|
|
|
|
let mut _30: &mut std::task::Context<'_>;
|
|
|
|
let mut _31: &mut std::task::Context<'_>;
|
|
|
|
let mut _32: isize;
|
|
|
|
let mut _34: !;
|
|
|
|
let mut _35: &mut std::task::Context<'_>;
|
|
|
|
let mut _36: ();
|
|
|
|
let mut _37: ();
|
|
|
|
let mut _38: &mut std::task::Context<'_>;
|
|
|
|
let mut _39: u32;
|
2022-12-20 08:15:29 -06:00
|
|
|
scope 1 {
|
2024-03-22 19:43:53 -05:00
|
|
|
debug __awaitee => (((*(_1.0: &mut {async fn body of b()})) as variant#3).0: {async fn body of a()});
|
2023-06-06 08:47:00 -05:00
|
|
|
let _17: ();
|
2022-12-20 08:15:29 -06:00
|
|
|
scope 2 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug result => _17;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
}
|
2024-02-27 05:57:52 -06:00
|
|
|
scope 3 {
|
2024-03-22 19:43:53 -05:00
|
|
|
debug __awaitee => (((*(_1.0: &mut {async fn body of b()})) as variant#4).0: {async fn body of a()});
|
2023-06-06 08:47:00 -05:00
|
|
|
let _33: ();
|
2024-02-27 05:57:52 -06:00
|
|
|
scope 4 {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug result => _33;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2024-03-22 19:43:53 -05:00
|
|
|
_39 = discriminant((*(_1.0: &mut {async fn body of b()})));
|
2024-02-11 21:56:03 -06:00
|
|
|
switchInt(move _39) -> [0: bb1, 1: bb29, 3: bb27, 4: bb28, otherwise: bb8];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_38 = move _2;
|
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
|
|
|
StorageLive(_5);
|
|
|
|
_5 = a() -> [return: bb2, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2024-03-22 19:43:53 -05:00
|
|
|
_4 = <{async fn body of a()} as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_5);
|
2022-10-15 04:00:32 -05:00
|
|
|
PlaceMention(_4);
|
2023-06-06 08:47:00 -05:00
|
|
|
nop;
|
2024-03-22 19:43:53 -05:00
|
|
|
(((*(_1.0: &mut {async fn body of b()})) as variant#3).0: {async fn body of a()}) = move _4;
|
2023-06-06 08:47:00 -05:00
|
|
|
goto -> bb4;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_8);
|
|
|
|
StorageLive(_9);
|
|
|
|
StorageLive(_10);
|
|
|
|
StorageLive(_11);
|
|
|
|
StorageLive(_12);
|
2024-03-22 19:43:53 -05:00
|
|
|
_12 = &mut (((*(_1.0: &mut {async fn body of b()})) as variant#3).0: {async fn body of a()});
|
2023-06-06 08:47:00 -05:00
|
|
|
_11 = &mut (*_12);
|
2024-03-22 19:43:53 -05:00
|
|
|
_10 = Pin::<&mut {async fn body of a()}>::new_unchecked(move _11) -> [return: bb5, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb5: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_11);
|
|
|
|
StorageLive(_13);
|
|
|
|
StorageLive(_14);
|
|
|
|
StorageLive(_15);
|
|
|
|
_15 = copy _38;
|
|
|
|
_14 = move _15;
|
|
|
|
goto -> bb6;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb6: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_13 = &mut (*_14);
|
|
|
|
StorageDead(_15);
|
2024-03-22 19:43:53 -05:00
|
|
|
_9 = <{async fn body of a()} as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb7: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_13);
|
|
|
|
StorageDead(_10);
|
2022-10-15 04:00:32 -05:00
|
|
|
PlaceMention(_9);
|
2023-06-06 08:47:00 -05:00
|
|
|
_16 = discriminant(_9);
|
2024-02-11 21:56:03 -06:00
|
|
|
switchInt(move _16) -> [0: bb10, 1: bb9, otherwise: bb8];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb8: {
|
2024-02-11 21:56:03 -06:00
|
|
|
unreachable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb9: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_8 = const ();
|
|
|
|
StorageDead(_14);
|
|
|
|
StorageDead(_12);
|
|
|
|
StorageDead(_9);
|
|
|
|
StorageDead(_8);
|
|
|
|
StorageLive(_19);
|
|
|
|
StorageLive(_20);
|
|
|
|
_20 = ();
|
|
|
|
_0 = Poll::<()>::Pending;
|
2023-12-08 18:00:00 -06:00
|
|
|
StorageDead(_3);
|
|
|
|
StorageDead(_4);
|
|
|
|
StorageDead(_19);
|
|
|
|
StorageDead(_20);
|
2024-03-22 19:43:53 -05:00
|
|
|
discriminant((*(_1.0: &mut {async fn body of b()}))) = 3;
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb10: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_17);
|
|
|
|
_17 = copy ((_9 as Ready).0: ());
|
|
|
|
_3 = copy _17;
|
|
|
|
StorageDead(_17);
|
|
|
|
StorageDead(_14);
|
|
|
|
StorageDead(_12);
|
|
|
|
StorageDead(_9);
|
|
|
|
StorageDead(_8);
|
2024-03-22 19:43:53 -05:00
|
|
|
drop((((*(_1.0: &mut {async fn body of b()})) as variant#3).0: {async fn body of a()})) -> [return: bb12, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb11: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_20);
|
|
|
|
_38 = move _19;
|
|
|
|
StorageDead(_19);
|
|
|
|
_7 = const ();
|
|
|
|
goto -> bb4;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb12: {
|
2023-06-06 08:47:00 -05:00
|
|
|
nop;
|
|
|
|
goto -> bb13;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb13: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_4);
|
|
|
|
StorageDead(_3);
|
|
|
|
StorageLive(_21);
|
|
|
|
StorageLive(_22);
|
|
|
|
_22 = a() -> [return: bb14, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb14: {
|
2024-03-22 19:43:53 -05:00
|
|
|
_21 = <{async fn body of a()} as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb15: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_22);
|
2022-10-15 04:00:32 -05:00
|
|
|
PlaceMention(_21);
|
2023-06-06 08:47:00 -05:00
|
|
|
nop;
|
2024-03-22 19:43:53 -05:00
|
|
|
(((*(_1.0: &mut {async fn body of b()})) as variant#4).0: {async fn body of a()}) = move _21;
|
2023-06-06 08:47:00 -05:00
|
|
|
goto -> bb16;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb16: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_24);
|
|
|
|
StorageLive(_25);
|
|
|
|
StorageLive(_26);
|
|
|
|
StorageLive(_27);
|
|
|
|
StorageLive(_28);
|
2024-03-22 19:43:53 -05:00
|
|
|
_28 = &mut (((*(_1.0: &mut {async fn body of b()})) as variant#4).0: {async fn body of a()});
|
2023-06-06 08:47:00 -05:00
|
|
|
_27 = &mut (*_28);
|
2024-03-22 19:43:53 -05:00
|
|
|
_26 = Pin::<&mut {async fn body of a()}>::new_unchecked(move _27) -> [return: bb17, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb17: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_27);
|
|
|
|
StorageLive(_29);
|
|
|
|
StorageLive(_30);
|
|
|
|
StorageLive(_31);
|
|
|
|
_31 = copy _38;
|
|
|
|
_30 = move _31;
|
|
|
|
goto -> bb18;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb18: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_29 = &mut (*_30);
|
|
|
|
StorageDead(_31);
|
2024-03-22 19:43:53 -05:00
|
|
|
_25 = <{async fn body of a()} as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb19: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_29);
|
|
|
|
StorageDead(_26);
|
2022-10-15 04:00:32 -05:00
|
|
|
PlaceMention(_25);
|
2023-06-06 08:47:00 -05:00
|
|
|
_32 = discriminant(_25);
|
2024-02-11 21:56:03 -06:00
|
|
|
switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb8];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb20: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_24 = const ();
|
|
|
|
StorageDead(_30);
|
|
|
|
StorageDead(_28);
|
|
|
|
StorageDead(_25);
|
|
|
|
StorageDead(_24);
|
|
|
|
StorageLive(_35);
|
|
|
|
StorageLive(_36);
|
|
|
|
_36 = ();
|
|
|
|
_0 = Poll::<()>::Pending;
|
2023-12-08 18:00:00 -06:00
|
|
|
StorageDead(_21);
|
|
|
|
StorageDead(_35);
|
|
|
|
StorageDead(_36);
|
2024-03-22 19:43:53 -05:00
|
|
|
discriminant((*(_1.0: &mut {async fn body of b()}))) = 4;
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
bb21: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_33);
|
|
|
|
_33 = copy ((_25 as Ready).0: ());
|
|
|
|
_37 = copy _33;
|
|
|
|
StorageDead(_33);
|
|
|
|
StorageDead(_30);
|
|
|
|
StorageDead(_28);
|
|
|
|
StorageDead(_25);
|
|
|
|
StorageDead(_24);
|
2024-03-22 19:43:53 -05:00
|
|
|
drop((((*(_1.0: &mut {async fn body of b()})) as variant#4).0: {async fn body of a()})) -> [return: bb23, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-02-24 15:32:10 -06:00
|
|
|
bb22: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_36);
|
|
|
|
_38 = move _35;
|
|
|
|
StorageDead(_35);
|
|
|
|
_7 = const ();
|
|
|
|
goto -> bb16;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-02-24 15:32:10 -06:00
|
|
|
bb23: {
|
2023-06-06 08:47:00 -05:00
|
|
|
nop;
|
|
|
|
goto -> bb24;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-02-24 15:32:10 -06:00
|
|
|
bb24: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageDead(_21);
|
2023-01-28 12:49:48 -06:00
|
|
|
goto -> bb26;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-02-24 15:32:10 -06:00
|
|
|
bb25: {
|
2023-06-06 08:47:00 -05:00
|
|
|
_0 = Poll::<()>::Ready(move _37);
|
2024-03-22 19:43:53 -05:00
|
|
|
discriminant((*(_1.0: &mut {async fn body of b()}))) = 1;
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-02-24 15:32:10 -06:00
|
|
|
bb26: {
|
2023-01-28 12:49:48 -06:00
|
|
|
goto -> bb25;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb27: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_3);
|
|
|
|
StorageLive(_4);
|
|
|
|
StorageLive(_19);
|
|
|
|
StorageLive(_20);
|
|
|
|
_19 = move _2;
|
|
|
|
goto -> bb11;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-01-28 12:49:48 -06:00
|
|
|
bb28: {
|
2023-06-06 08:47:00 -05:00
|
|
|
StorageLive(_21);
|
|
|
|
StorageLive(_35);
|
|
|
|
StorageLive(_36);
|
|
|
|
_35 = move _2;
|
|
|
|
goto -> bb22;
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
|
2023-01-28 12:49:48 -06:00
|
|
|
bb29: {
|
|
|
|
assert(const false, "`async fn` resumed after completion") -> [success: bb29, unwind unreachable];
|
2022-12-20 08:15:29 -06:00
|
|
|
}
|
|
|
|
}
|