diff options
Diffstat (limited to 'tests/ui/async-await/async-closures/higher-ranked.rs')
| -rw-r--r-- | tests/ui/async-await/async-closures/higher-ranked.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/ui/async-await/async-closures/higher-ranked.rs b/tests/ui/async-await/async-closures/higher-ranked.rs index 5bbcc7041a8..17b5116cceb 100644 --- a/tests/ui/async-await/async-closures/higher-ranked.rs +++ b/tests/ui/async-await/async-closures/higher-ranked.rs @@ -1,10 +1,16 @@ +// aux-build:block-on.rs // edition:2021 -// check-pass +// build-pass #![feature(async_closure)] +extern crate block_on; + fn main() { - let x = async move |x: &str| { - println!("{x}"); - }; + block_on::block_on(async { + let x = async move |x: &str| { + println!("{x}"); + }; + x("hello!").await; + }); } |
