1 // MIR for `b::{closure#0}` 0 coroutine_resume
2 /* coroutine_layout = CoroutineLayout {
6 DefId(0:4 ~ async_await[ccf8]::a::{closure#0}),
11 CoroutineWitness(DefId(0:4 ~ async_await[ccf8]::a::{closure#0}), []),
16 source_info: SourceInfo {
17 span: $DIR/async_await.rs:16:9: 16:14 (#8),
20 ignore_for_traits: false,
22 _1: CoroutineSavedTy {
24 DefId(0:4 ~ async_await[ccf8]::a::{closure#0}),
26 std::future::ResumeTy,
29 CoroutineWitness(DefId(0:4 ~ async_await[ccf8]::a::{closure#0}), []),
34 source_info: SourceInfo {
35 span: $DIR/async_await.rs:17:9: 17:14 (#10),
38 ignore_for_traits: false,
48 storage_conflicts: BitMatrix(2x2) {
54 fn b::{closure#0}(_1: Pin<&mut {async fn body@$DIR/async_await.rs:15:18: 18:2}>, _2: &mut Context<'_>) -> Poll<()> {
55 debug _task_context => _38;
56 let mut _0: std::task::Poll<()>;
58 let mut _4: {async fn body@$DIR/async_await.rs:12:14: 12:16};
59 let mut _5: {async fn body@$DIR/async_await.rs:12:14: 12:16};
60 let mut _6: {async fn body@$DIR/async_await.rs:12:14: 12:16};
63 let mut _9: std::task::Poll<()>;
64 let mut _10: std::pin::Pin<&mut {async fn body@$DIR/async_await.rs:12:14: 12:16}>;
65 let mut _11: &mut {async fn body@$DIR/async_await.rs:12:14: 12:16};
66 let mut _12: &mut {async fn body@$DIR/async_await.rs:12:14: 12:16};
67 let mut _13: &mut std::task::Context<'_>;
68 let mut _14: &mut std::task::Context<'_>;
69 let mut _15: &mut std::task::Context<'_>;
72 let mut _19: &mut std::task::Context<'_>;
74 let mut _21: {async fn body@$DIR/async_await.rs:12:14: 12:16};
75 let mut _22: {async fn body@$DIR/async_await.rs:12:14: 12:16};
76 let mut _23: {async fn body@$DIR/async_await.rs:12:14: 12:16};
78 let mut _25: std::task::Poll<()>;
79 let mut _26: std::pin::Pin<&mut {async fn body@$DIR/async_await.rs:12:14: 12:16}>;
80 let mut _27: &mut {async fn body@$DIR/async_await.rs:12:14: 12:16};
81 let mut _28: &mut {async fn body@$DIR/async_await.rs:12:14: 12:16};
82 let mut _29: &mut std::task::Context<'_>;
83 let mut _30: &mut std::task::Context<'_>;
84 let mut _31: &mut std::task::Context<'_>;
87 let mut _35: &mut std::task::Context<'_>;
90 let mut _38: &mut std::task::Context<'_>;
93 debug __awaitee => (((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#3).0: {async fn body@$DIR/async_await.rs:12:14: 12:16});
102 debug __awaitee => (((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#4).0: {async fn body@$DIR/async_await.rs:12:14: 12:16});
112 _39 = discriminant((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})));
113 switchInt(move _39) -> [0: bb1, 1: bb29, 3: bb27, 4: bb28, otherwise: bb30];
121 _5 = a() -> [return: bb2, unwind unreachable];
125 _4 = <{async fn body@$DIR/async_await.rs:12:14: 12:16} as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable];
132 (((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#3).0: {async fn body@$DIR/async_await.rs:12:14: 12:16}) = move _4;
142 _12 = &mut (((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#3).0: {async fn body@$DIR/async_await.rs:12:14: 12:16});
144 _10 = Pin::<&mut {async fn body@$DIR/async_await.rs:12:14: 12:16}>::new_unchecked(move _11) -> [return: bb5, unwind unreachable];
160 _9 = <{async fn body@$DIR/async_await.rs:12:14: 12:16} as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable];
167 _16 = discriminant(_9);
168 switchInt(move _16) -> [0: bb10, 1: bb8, otherwise: bb9];
180 _0 = Poll::<()>::Pending;
181 discriminant((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2}))) = 3;
191 _17 = ((_9 as Ready).0: ());
198 drop((((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#3).0: {async fn body@$DIR/async_await.rs:12:14: 12:16})) -> [return: bb12, unwind unreachable];
219 _22 = a() -> [return: bb14, unwind unreachable];
223 _21 = <{async fn body@$DIR/async_await.rs:12:14: 12:16} as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable];
230 (((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#4).0: {async fn body@$DIR/async_await.rs:12:14: 12:16}) = move _21;
240 _28 = &mut (((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#4).0: {async fn body@$DIR/async_await.rs:12:14: 12:16});
242 _26 = Pin::<&mut {async fn body@$DIR/async_await.rs:12:14: 12:16}>::new_unchecked(move _27) -> [return: bb17, unwind unreachable];
258 _25 = <{async fn body@$DIR/async_await.rs:12:14: 12:16} as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable];
265 _32 = discriminant(_25);
266 switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb9];
278 _0 = Poll::<()>::Pending;
279 discriminant((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2}))) = 4;
285 _33 = ((_25 as Ready).0: ());
292 drop((((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2})) as variant#4).0: {async fn body@$DIR/async_await.rs:12:14: 12:16})) -> [return: bb23, unwind unreachable];
314 _0 = Poll::<()>::Ready(move _37);
315 discriminant((*(_1.0: &mut {async fn body@$DIR/async_await.rs:15:18: 18:2}))) = 1;
341 assert(const false, "`async fn` resumed after completion") -> [success: bb29, unwind unreachable];