2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2023-10-19 16:46:28 -05:00
|
|
|
// This test makes sure that the coroutine MIR pass eliminates all calls to
|
2022-12-20 08:15:29 -06:00
|
|
|
// `get_context`, and that the MIR argument type for an async fn and all locals
|
|
|
|
// related to `yield` are `&mut Context`, and its return type is `Poll`.
|
|
|
|
|
|
|
|
// edition:2018
|
|
|
|
// compile-flags: -C panic=abort
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
2023-10-19 16:46:28 -05:00
|
|
|
// EMIT_MIR async_await.a-{closure#0}.coroutine_resume.0.mir
|
2022-12-20 08:15:29 -06:00
|
|
|
async fn a() {}
|
|
|
|
|
2023-10-19 16:46:28 -05:00
|
|
|
// EMIT_MIR async_await.b-{closure#0}.coroutine_resume.0.mir
|
2022-12-20 08:15:29 -06:00
|
|
|
pub async fn b() {
|
|
|
|
a().await;
|
|
|
|
a().await
|
|
|
|
}
|