Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Coroutine Closures #3783

Open
carolynzech opened this issue Dec 16, 2024 · 0 comments
Open

Add support for Coroutine Closures #3783

carolynzech opened this issue Dec 16, 2024 · 0 comments
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] Unsupported Construct Add support to an unsupported construct

Comments

@carolynzech
Copy link
Contributor

Requested feature: Add support for coroutine closures
Use case: async closures
Link to relevant documentation (Rust reference, Nomicon, RFC): RFC, Addition to StableMIR

Test case:

(Test taken from https://github.com/rust-lang/rust/blob/master/tests/codegen/async-closure-debug.rs)

fn async_closure_test(upvar: &str) -> impl AsyncFn() + '_ {
    async move || {
        let hello = String::from("hello");
        println!("{hello}, {upvar}");
    }
}

fn main() {
    let _async_closure = async_closure_test("world");
}
@carolynzech carolynzech added [C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] Unsupported Construct Add support to an unsupported construct labels Dec 16, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 16, 2024
Culprit PRs:
- rust-lang/rust#133938, specifically
rust-lang/rust@1d56943
- rust-lang/rust#134295

For coroutine closures, I opened #3783 to track feature support--adding
support for this appears non-trivial, and I didn't want to block
toolchain upgrades on it.

Resolves #3781

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Feature / Enhancement A new feature request or enhancement to an existing feature. [E] Unsupported Construct Add support to an unsupported construct
Projects
None yet
Development

No branches or pull requests

1 participant