-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking Issue for Supertrait auto impl #149556
Copy link
Copy link
Open
Labels
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 RFCI-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
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 RFCI-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Exploration
This is a tracking issue for the RFC 3851 rust-lang/rfcs#3851.
The feature gate for the issue is
#![feature(supertrait_auto_impl)].Motivation
We propose supertrait
auto implas one of the solutions to facilitate trait evolution in the Rust ecosystem.auto implwould reduce the effort to rewrite trait implementation by transparently resolving items from the big subtrait to supertraits and by providing a mechanism to supply default implementation of supertraits with clear syntatical notation.Current state of the language
Rust today would require great effort to re-organise the trait hierarchy, especially concerning the downstream trait implementations. As an illustration, moving a trait associated item to a higher supertrait would require all downstream implementations to split.
Previously, we have the following.
By splitting the
BigTrait, so would one need to split all the existing implementations.Experiment proposal
We would like to carry out an experiment to introduce supertrait
auto impl, so that the existing implementation will continue to "just work."There are more motivating examples in rust-lang/rfcs#3851 which are the use cases we would like to enable when trait refactoring is concerned.
Steps
rustfmtsupport, seeStyle updatesclippylintscargo-semversupportrustfmtUnresolved Questions
TBD
Implementation history