-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Closed
Copy link
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.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 RFCF-async_fn_in_traitStatic async fn in traitsStatic async fn in traitsF-return_position_impl_trait_in_trait`#![feature(return_position_impl_trait_in_trait)]``#![feature(return_position_impl_trait_in_trait)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.Status: The implementation is incomplete.T-langRelevant to the language teamRelevant to the language team
Description
- This is a tracking issue for the RFC "static async fn in traits" (Static async fn in traits rfcs#3185) and "Return position
impl Traitin traits" (Return positionimpl Traitin traits rfcs#3425). - The feature gate for async fn in traits is
#![feature(async_fn_in_trait)]. - The feature gate for return position
impl Traitin traits is#![feature(return_position_impl_trait_in_trait)]. - This feature is developed as part of the async fundamentals initiative -- see that website for more information!
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the RFC
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR: Stabilize
async fnand return-positionimpl Traitin trait #115822
Unresolved Questions
Async fn in trait
Return position impl Trait in trait
- Should we stabilize this feature together with
async fnto mitigate hazards of writing a trait that is not forwards-compatible with its desugaring? - Resolution of RPITIT is allowed to name any in-scope lifetime parameter, unlike inherent RPIT methods #112194
- Note that this might impact the desugaring, as described in this comment.
- Should we limit the legal positions for
impl Traitto positions that are nameable using upcoming features like return-type notation (RTN)? (See this comment for an example.)
Implementation history
Async fn in trait
F-async_fn_in_trait
- Only generate closure def id for async fns with body #102244
- Split out async_fn_in_trait into a separate feature #100734
Return position impl Trait in trait
F-return_position_impl_trait_in_trait
Several of these include code specific to async fn in trait.
- Initial implementation of return-position
impl Traitin traits #101224 - Equate fn outputs when inferring RPITIT hidden types #101614
- Make
compare_predicate_entailmentno longer a query #101615 - Check that the types in return position
impl Traitin traits are well-formed #101676 - Support default-body trait functions with return-position
impl Traitin traits #101679 - Calculate
ProjectionTy::trait_def_idfor return-positionimpl Traitin trait correctly #102152 - Resolve async fn signature even without body (e.g., in trait) #102161
- Serialize return-position
impl Traitin trait hidden values in foreign libraries #102164 - Avoid ICE in printing RPITIT type #102597
- Fix subst issues with return-position
impl Traitin trait #102334 - Handle return-position
impl Traitin traits properly inregister_hidden_type#103355
eldruin, sksat, tema3210, songzhi, the-mousaillon and 183 moreyerke, TennyZhuang, kellerkindt, brainstorm, audunhalland and 39 moreyerke, kellerkindt, brainstorm, audunhalland, hyunsik and 34 morekonard, ivansglazunov, uselessgoddess, udoprog, attila-lin and 40 moreschneiderfelipe, szagi3891, Dengjianping, ryoqun, Cardosaum and 9 more
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.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 RFCF-async_fn_in_traitStatic async fn in traitsStatic async fn in traitsF-return_position_impl_trait_in_trait`#![feature(return_position_impl_trait_in_trait)]``#![feature(return_position_impl_trait_in_trait)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.Status: The implementation is incomplete.T-langRelevant to the language teamRelevant to the language team