Async fn fundamentals

This initiative is part of the overall async vision roadmap.

Impact

  • Able to write async fn in traits and trait impls
    • Able to easily declare that T: Trait + Send where "every async fn in Trait returns a Send future"
    • Traits that use async fn can still be dyn safe though some tuning may be required
    • Async functions in traits desugar to impl Trait in traits
  • Able to write "async fn drop" to declare that the destructor may await
  • Support for async closures

Milestones

MilestoneStateKey participants
Author evaluation doc for static async traitdone 🎉tmandry
Author evaluation doc for dyn async traitdone 🎉tmandry
Author evaluation doc for async drop💤
Author evaluation doc for impl Trait in traitsdonetmandry
Stabilize type alias impl traitin-progressoli-obk
Stabilize generic associated typesdone 🎉jackh726
Author RFC for async fn in traitsdone 🎉
Author evaluation doc for async closuresblog posts authored, doc pendingnikomatsakis
Author RFC for impl trait in traitsdone
Feature complete for async fn in traitsdone 🎉compiler-errors
Feature complete for impl Trait in traitsdone 🎉compiler-errors
Feature complete for async drop💤
Feature complete for async closures💤
Stabilize async fn in traitsproposedcompiler-errors
Stabilize impl trait in traitsproposedcompiler-errors
Stabilize async drop💤
Stabilize async closures💤

Design discussions

This directory hosts notes on important design discussions along with their resolutions. In the table of contents, you will find the overall status:

  • ✅ -- Settled! Input only needed if you have identified a fresh consideration that is not covered by the write-up.
  • 💬 -- Under active discussion. Check the write-up, which may contain a list of questions or places where feedback is desired.
  • 💤 -- Paused. Not under active discussion, but we may be updating the write-up from time to time with details.