You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow the tower::Service trait to be split into a non-Sync supertrait and a Sync (thread-safe) subtrait.
The design should incorporate the feedback from the Evolving trait hierarchies
language design meeting. The design should also set the stage for future changes to allow for
the more general case of splitting items out into supertraits.
traitSubtrait:Supertrait{
auto implSupertrait{// Supertrait items defined in terms of Subtrait items, if any}}
Additionally, there is an open question around the syntax of auto impl for unsafe supertraits. The current proposal is to require unsafe auto impl Supertrait.
Whether to require impls to opt-out of auto impls
The current RFC proposes that
implSupertraitforMyType{}implSubtraitforMyType{// Required in order to manually write `Supertrait` for MyType.externimplSupertrait;}
This makes it explicit via opt-out whether an auto impl is being applied. However, this is in conflict with the goal of allowing auto impls to be added to existing trait hierarchies. The RFC proposes to resolve this via a temporary attribute which triggers a warning. See my comment here.
The 2025h2 goal period is now over, so I'm closing this issue. Thanks to everyone who contributed! The Implement Supertrait auto impl and Arbirary Self Types goals will continue this work in the 2026 period. Authors are welcome to leave a final comment about the goal's outcome.
Activity
nikomatsakis commentedon Sep 16, 2025
This issue is intended for status updates only.
For general questions or comments, please contact the owner(s) directly.
cramertj commentedon Sep 30, 2025
Current status: there is an RFC for
auto implsupertraits that has received some discussion and updates (thank you, @dingxiangfei2009!).The major open questions currently are:
Syntax
The current RFC proposes:
Additionally, there is an open question around the syntax of
auto implfor unsafe supertraits. The current proposal is to requireunsafe auto impl Supertrait.Whether to require impls to opt-out of
auto implsThe current RFC proposes that
This makes it explicit via opt-out whether an
auto implis being applied. However, this is in conflict with the goal of allowingauto impls to be added to existing trait hierarchies. The RFC proposes to resolve this via a temporary attribute which triggers a warning. See my comment here.Note that properly resolving whether or not to apply an
auto implrequires coherence-like analysis.cramertj commentedon Dec 17, 2025
Current status:
auto implsupertraits has been updated to address SemVer compatibility issues.nxsaken commentedon May 7, 2026
The 2025h2 goal period is now over, so I'm closing this issue. Thanks to everyone who contributed! The Implement Supertrait
auto impland Arbirary Self Types goals will continue this work in the 2026 period. Authors are welcome to leave a final comment about the goal's outcome.