Repository navigation
Tracking issue for #![feature(async_closure)] (RFC 2394 / RFC 3668) #62290
Copy link
Copy link
Open
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-async-closures`async || {}``async || {}`A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-langRelevant to the language teamRelevant to the language teamWG-asyncWorking group: Async & awaitWorking group: Async & awaitrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Description
This is a tracking issue for #![feature(async_closure)] (rust-lang/rfcs#2394).
The feature gate provides the async |...| expr closure syntax.
As with all tracking issues for the language, please file anything unrelated to implementation history, that is: bugs and design questions, as separate issues as opposed to leaving comments here. The status of the feature should also be covered by the feature gate label. Please do not ask about developments here.
Steps:
- Implement the RFC
- Accept another RFC
- Implement it: Rework support for async closures; allow them to return futures that borrow from the closure's captures #120361
- Adjust documentation (see instructions on rustc-guide)
- Stabilization PR (see instructions on rustc-guide)
Open questions (RFC 2394)
- Interaction between signature deduction and new solver.
Open questions (RFC 3668)
- Which syntax should we choose for bounds?
Related
Reacted by Legokichi Duckscallion, Sacha Arbonel, chenyang, Alex Gaynor, Jakub Beránek, Aymeric Beaumet, Squirrel, Artem Starikov, Miles Granger, Sebastian Urban and 252 more
Reacted by Lily, Yasin and Hos.Mercury
Reacted by Rob Gilson, Skyper, tatounee, Maksim, Christoffer Vikström, Takumi Shimada, Diego Stratta, Nikolai Vazquez, François de Mareschal, Lasse Rosenow and 18 more
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-async-closures`async || {}``async || {}`A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-langRelevant to the language teamRelevant to the language teamWG-asyncWorking group: Async & awaitWorking group: Async & awaitrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Activity
Rollup merge of rust-lang#62292 - Centril:split-async-closures, r=cra…
Rollup merge of rust-lang#62292 - Centril:split-async-closures, r=cra…
Rollup merge of rust-lang#62292 - Centril:split-async-closures, r=cra…
Rollup merge of rust-lang#62292 - Centril:split-async-closures, r=cra…
Rollup merge of rust-lang#62292 - Centril:split-async-closures, r=cra…
Rollup merge of rust-lang#62292 - Centril:split-async-closures, r=cra…
44 remaining items
chore(catalog): Debug hook for responses
Auto merge of rust-lang#127291 - compiler-errors:output-ty-stab, r=<try>
Rollup merge of rust-lang#127097 - compiler-errors:async-closure-lint…
Auto merge of rust-lang#127097 - compiler-errors:async-closure-lint, …
c-git commentedon Jul 16, 2024
Not sure if this is a suitable place to point to the workaround I use. But this is where the compiler points me every time I bump into this. This post pointed me in the right direction. My main takeaway is put the async on the right of || not the left and then progress becomes possible again (at least for my use cases).
Copy of code so others don't need to follow the link
Edit
After I'd added my comment I went to re-read the posts and saw the one quoted below that already provided a solution but I didn't find it when I searched because I used the word workaround and possibly others will as well so I decided to leave it.
[-]Tracking issue for `#![feature(async_closure)]` (RFC 2394)[/-][+]Tracking issue for `#![feature(async_closure)]` (RFC 2394) (RFC 3668)[/+][-]Tracking issue for `#![feature(async_closure)]` (RFC 2394) (RFC 3668)[/-][+]Tracking issue for `#![feature(async_closure)]` (RFC 2394 / RFC 3668)[/+]compiler-errors commentedon Dec 13, 2024
this is done
tisonkun commentedon Apr 19, 2025
[Just a data point]
Today I meet an issue that when the return type
CallRefFuturecannot be used in stable channel, some code cannot be written:returns:
returns:
dtolnay commentedon Aug 15, 2025
Reopening because
async Traittrait bounds still refers to this tracking issue as of the latest nightly.A new tracking issue should be created for
feature(async_trait_bounds).Rollup merge of rust-lang#154109 - Enselic:unifying-function-types-in…
Rollup merge of rust-lang#154109 - Enselic:unifying-function-types-in…
Rollup merge of rust-lang#154109 - Enselic:unifying-function-types-in…