From 55e46612c1ccceb30a7a6acf11fd485f34e393e5 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 3 Apr 2024 12:16:17 -0400 Subject: Force `move` async-closures that are `FnOnce` to make their inner coroutines also `move` --- tests/ui/async-await/async-closures/captures.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/ui/async-await/async-closures/captures.rs') diff --git a/tests/ui/async-await/async-closures/captures.rs b/tests/ui/async-await/async-closures/captures.rs index 6011292b645..0a9d0529bf5 100644 --- a/tests/ui/async-await/async-closures/captures.rs +++ b/tests/ui/async-await/async-closures/captures.rs @@ -1,7 +1,7 @@ //@ aux-build:block-on.rs //@ edition:2021 - - +//@ run-pass +//@ check-run-results // Same as miri's `tests/pass/async-closure-captures.rs`, keep in sync @@ -104,14 +104,12 @@ async fn async_main() { let x = Hello(8); let c = force_fnonce(async || { println!("{x:?}"); - //~^ ERROR `x` does not live long enough }); call_once(c).await; let x = &Hello(9); let c = force_fnonce(async || { println!("{x:?}"); - //~^ ERROR `x` does not live long enough }); call_once(c).await; } -- cgit 1.4.1-3-g733a5