diff options
Diffstat (limited to 'tests/ui/async-await/async-closures/refd.rs')
| -rw-r--r-- | tests/ui/async-await/async-closures/refd.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/ui/async-await/async-closures/refd.rs b/tests/ui/async-await/async-closures/refd.rs index 1d9bc1a601b..0b8d3d7aff5 100644 --- a/tests/ui/async-await/async-closures/refd.rs +++ b/tests/ui/async-await/async-closures/refd.rs @@ -2,8 +2,6 @@ //@ edition:2021 //@ build-pass -// check that `&{async-closure}` implements `AsyncFn`. - #![feature(async_closure)] extern crate block_on; @@ -13,6 +11,15 @@ struct NoCopy; fn main() { block_on::block_on(async { async fn call_once(x: impl async Fn()) { x().await } - call_once(&async || {}).await + + // check that `&{async-closure}` implements `async Fn`. + call_once(&async || {}).await; + + // check that `&{closure}` implements `async Fn`. + call_once(&|| async {}).await; + + // check that `&fndef` implements `async Fn`. + async fn foo() {} + call_once(&foo).await; }); } |
