diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-26 23:06:38 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-27 17:39:20 +0000 |
| commit | c8e3f35eb631c35bc7aabf358b7ca5c2a7fbfd1e (patch) | |
| tree | 168353e8024405f9d487a470546d07cddb8ebc53 /tests/ui/async-await/async-closures/move-is-async-fn.rs | |
| parent | 2252ff730285decb81837db51a922608b2f036cc (diff) | |
| download | rust-c8e3f35eb631c35bc7aabf358b7ca5c2a7fbfd1e.tar.gz rust-c8e3f35eb631c35bc7aabf358b7ca5c2a7fbfd1e.zip | |
Flesh out a few more tests
Diffstat (limited to 'tests/ui/async-await/async-closures/move-is-async-fn.rs')
| -rw-r--r-- | tests/ui/async-await/async-closures/move-is-async-fn.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/ui/async-await/async-closures/move-is-async-fn.rs b/tests/ui/async-await/async-closures/move-is-async-fn.rs index 0ccd137266d..79e2298f609 100644 --- a/tests/ui/async-await/async-closures/move-is-async-fn.rs +++ b/tests/ui/async-await/async-closures/move-is-async-fn.rs @@ -2,7 +2,7 @@ //@ edition:2021 //@ build-pass -#![feature(async_closure)] +#![feature(async_closure, async_fn_traits)] extern crate block_on; @@ -15,7 +15,11 @@ fn main() { c().await; c().await; - fn is_static<T: 'static>(_: T) {} - is_static(c); + fn is_static<T: 'static>(_: &T) {} + is_static(&c); + + // Check that `<{async fn} as AsyncFnOnce>::CallOnceFuture` owns its captures. + fn call_once<F: async FnOnce()>(f: F) -> F::CallOnceFuture { f() } + is_static(&call_once(c)); }); } |
