-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not call query to compute coroutine layout for synthetic body of a…
…sync closure
- Loading branch information
1 parent
78d5c04
commit 384aed8
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/ui/async-await/async-closures/validate-synthetic-body.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@ check-pass | ||
//@ edition: 2021 | ||
|
||
#![feature(async_closure)] | ||
|
||
// Make sure that we don't hit a query cycle when validating | ||
// the by-move coroutine body for an async closure. | ||
|
||
use std::future::Future; | ||
|
||
async fn test<Fut: Future>(operation: impl Fn() -> Fut) { | ||
operation().await; | ||
} | ||
|
||
pub async fn orchestrate_simple_crud() { | ||
test(async || async {}.await).await; | ||
} | ||
|
||
fn main() {} |