-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for trait aliases #41517
Copy link
Copy link
Open
0 / 10 of 1 issue completedLabels
A-trait-systemArea: Trait systemArea: Trait systemB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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-trait_alias`#![feature(trait_alias)]``#![feature(trait_alias)]`S-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.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
A-trait-systemArea: Trait systemArea: Trait systemB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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-trait_alias`#![feature(trait_alias)]``#![feature(trait_alias)]`S-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.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.
View all comments
This is a tracking issue for the feature trait aliases (originally specified in RFC 1733).
The feature gate for the issue is
#![feature(trait_alias)].Important
The implementation of this feature is tracked separately in #55628.
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
unexpected definition: TraitAlias#57023 — Nightly Type Alias Compiler panicunexpected definition: TraitAliasINCOHERENT_AUTO_TRAIT_OBJECTSfuture-compatibility warning #57059 —INCOHERENT_AUTO_TRAIT_OBJECTSfuture-compatibility warning (superseded by add coherence future-compat warnings for marker-only trait objects #56481)Unresolved questions
Self? Or rather, should we really imply bounds whose self type isn'tSelfor a projection thereof?A: TraitAlias<B>(wheretrait TraitAlias<T: Bound> = Bound where X: From<Self>, Y: From<T>;) doesn't just implyA: BoundandX: From<A>but alsoB: BoundandY: From<B>.Self#152688 (comment)?Sizedbounds in trait objects, ban them "deeply" (through trait alias expansion), or permit them everywhere with no effect??Sizedbounds in trait alias bounds makes no sense whatsoever since we don't performSizedelaboration there (i.e., we don't implicitly add aSizedbound to trait aliases). For that reason PR RUST-147734 made them a hard error.?Sizeddon't get "inherited";Sizedelaboration happens in the relevant places without regard for any supertrait boundsdyn EmptyTraitAliasbe legal wheretrait EmptyTraitAlias =;?" In the current implementation, trait aliases get eagerly expanded inside trait object types and thusdyn EmptyTraitAliasends up getting rejected just likedyn(sic!). I guess it could behave liketrait EmptyTrait {}instead and thus get accepted. It's unclear if that's how one should interpret that question but it doesn't seem implausible.Implementation history
See #55628 instead.