Skip to content

Evolving trait hierarchies #393

Closed
Closed

Description

@nikomatsakis
Metadata
Point of contact @cramertj
Team(s) compiler, lang, libs-api, types
Goal document 2025h2/evolving-traits

Summary

Unblock the evolution of key trait hierarchies:

  • Adding Receiver
    as a supertrait of Deref.
  • 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.

Tasks and status

Activity

  1. added this to the 2025h2 milestone on Sep 16, 2025
  2. nikomatsakis commented on Sep 16, 2025

    @nikomatsakis
    ContributorAuthor

    This issue is intended for status updates only.

    For general questions or comments, please contact the owner(s) directly.

  3. locked and limited conversation to collaborators on Sep 16, 2025
  4. cramertj commented on Sep 30, 2025

    @cramertj
    Member

    Current status: there is an RFC for auto impl supertraits that has received some discussion and updates (thank you, @dingxiangfei2009!).

    The major open questions currently are:

    Syntax

    The current RFC proposes:

    trait Subtrait: Supertrait {
        auto impl Supertrait {
            // 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

    impl Supertrait for MyType {}
    
    impl Subtrait for MyType {
        // Required in order to manually write `Supertrait` for MyType.
        extern impl Supertrait;
    }

    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.

    Note that properly resolving whether or not to apply an auto impl requires coherence-like analysis.

  5. cramertj commented on Dec 17, 2025

    @cramertj
    Member

    Current status:

    • The RFC for auto impl supertraits has been updated to address SemVer compatibility issues.
    • There is a parsing PR kicking off an experimental implementation. The tracking issue for this experimental implementation is here.
  6. nxsaken commented on May 7, 2026

    @nxsaken
    Contributor

    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.

  7. added
    ex-2025h2Goals that were previously in 2025h2 (for reporting)
    on May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions