Open
Description
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");
}