]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/building/async_await.rs
Rollup merge of #107473 - rustbot:docs-update, r=ehuss
[rust.git] / tests / mir-opt / building / async_await.rs
1 // This test makes sure that the generator MIR pass eliminates all calls to
2 // `get_context`, and that the MIR argument type for an async fn and all locals
3 // related to `yield` are `&mut Context`, and its return type is `Poll`.
4
5 // edition:2018
6 // compile-flags: -C panic=abort
7
8 #![crate_type = "lib"]
9
10 // EMIT_MIR async_await.a-{closure#0}.generator_resume.0.mir
11 async fn a() {}
12
13 // EMIT_MIR async_await.b-{closure#0}.generator_resume.0.mir
14 pub async fn b() {
15     a().await;
16     a().await
17 }