Rollup merge of #109902 - Nilstrieb:107414test, r=compiler-errors

Add async-await test for #107414

fixes #107414

r? `@cjgillot`
This commit is contained in:
Yuki Okushi 2023-04-04 05:52:36 +09:00 committed by GitHub
commit 52dad9933b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,24 @@
// check-pass
// edition:2018
fn main() {}
struct StructA {}
struct StructB {}
impl StructA {
fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
true
}
}
async fn get_struct_a_async() -> StructA {
StructA {}
}
async fn ice() {
match Some(StructB {}) {
Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
_ => {}
}
}