about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/captures.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-04-03 12:16:17 -0400
committerMichael Goulet <michael@errs.io>2024-04-04 19:44:51 -0400
commit55e46612c1ccceb30a7a6acf11fd485f34e393e5 (patch)
tree76452998c0f2ad8406d6238e1c47a34ee3742eaf /tests/ui/async-await/async-closures/captures.rs
parent3d9d5d7c96ae3df2cfc47e933ab11ad5fa30f3bc (diff)
downloadrust-55e46612c1ccceb30a7a6acf11fd485f34e393e5.tar.gz
rust-55e46612c1ccceb30a7a6acf11fd485f34e393e5.zip
Force `move` async-closures that are `FnOnce` to make their inner coroutines also `move`
Diffstat (limited to 'tests/ui/async-await/async-closures/captures.rs')
-rw-r--r--tests/ui/async-await/async-closures/captures.rs6
1 files changed, 2 insertions, 4 deletions
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;
     }