diff options
| author | Michael Goulet <michael@errs.io> | 2024-04-03 12:16:17 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-04-04 19:44:51 -0400 |
| commit | 55e46612c1ccceb30a7a6acf11fd485f34e393e5 (patch) | |
| tree | 76452998c0f2ad8406d6238e1c47a34ee3742eaf /tests/ui/async-await/async-closures/captures.rs | |
| parent | 3d9d5d7c96ae3df2cfc47e933ab11ad5fa30f3bc (diff) | |
| download | rust-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.rs | 6 |
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; } |
