-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #120897 - compiler-errors:foreign-async-closure, r=ol…
…i-obk Encode `coroutine_for_closure` for foreign crates Async closures (and "coroutine closures" in general) need to have their child coroutine encoded. This PR does that. r? oli-obk
- Loading branch information
Showing
5 changed files
with
35 additions
and
0 deletions.
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
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
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
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,7 @@ | ||
// edition:2021 | ||
|
||
#![feature(async_closure)] | ||
|
||
pub fn closure() -> impl async Fn() { | ||
async || { /* Don't really need to do anything here. */ } | ||
} |
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 @@ | ||
// aux-build:block-on.rs | ||
// aux-build:foreign.rs | ||
// edition:2021 | ||
// build-pass | ||
|
||
#![feature(async_closure)] | ||
|
||
use std::future::Future; | ||
|
||
extern crate block_on; | ||
extern crate foreign; | ||
|
||
struct NoCopy; | ||
|
||
fn main() { | ||
block_on::block_on(async { | ||
foreign::closure()().await; | ||
}); | ||
} |