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
{{ message }}
Repository navigation
Tracking issue for 'Allow Self to appear in the where clause of trait impls' #38864
Proposes allowing the Self type to be used in every position in trait implementations, including where clauses and other parameters to the trait being implemented.
rustc 1.19.0-nightly (afa1240e5 2017-04-29)
error[E0275]: overflow evaluating the requirement `<SomeType as SomeTrait>::AssocType`
--> <anon>:9:6
|
9 | impl SomeTrait for SomeType where Self::AssocType: SomeOtherTrait {
| ^^^^^^^^^
|
= note: required because of the requirements on the impl of `SomeTrait` for `SomeType`
error: aborting due to previous error
Ah that's not part of the actual syntactical support (which works!), but rather the trait system.
You can reproduce by expanding Self::AssocType to <SomeType as SomeTrait>::AssocType.
This looks like it was overlooked in the RFC, and I'd suggest opening a separate issue.
I suppose we can keep this one open and depend on that issue but they're unrelated IMO.
cc @rust-lang/lang
The issue I raised still exists. I'm not sure how it was overlooked in the RFC, the example given from the RFC itself, and the text explicitly states that we'd like to be able to reference associated types from the trait being implemented. I agree that this is a fix that needs to happen in the trait system, not just syntactic support, but it is something the RFC calls out explicitly multiple times.
Could you open a separate ticket please, focused on that specific bug?
This is a tracking issue for the feature in general, and the feature in general was implemented and stabilized.
Activity
Auto merge of #38920 - petrochenkov:selfimpl, r=eddyb
Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
sgrif commentedon Apr 30, 2017
The RFC still isn't fully implemented. In particular, this example from the RFC text still fails to compile:
eddyb commentedon Apr 30, 2017
@sgrif What's the error?
Mark-Simulacrum commentedon Apr 30, 2017
https://is.gd/amqdSq:
eddyb commentedon Apr 30, 2017
Ah that's not part of the actual syntactical support (which works!), but rather the trait system.
You can reproduce by expanding
Self::AssocTypeto<SomeType as SomeTrait>::AssocType.This looks like it was overlooked in the RFC, and I'd suggest opening a separate issue.
I suppose we can keep this one open and depend on that issue but they're unrelated IMO.
cc @rust-lang/lang
steveklabnik commentedon Mar 12, 2019
According to the last comment here, it seems like maybe this is finished?
sgrif commentedon Mar 12, 2019
The issue I raised still exists. I'm not sure how it was overlooked in the RFC, the example given from the RFC itself, and the text explicitly states that we'd like to be able to reference associated types from the trait being implemented. I agree that this is a fix that needs to happen in the trait system, not just syntactic support, but it is something the RFC calls out explicitly multiple times.
petrochenkov commentedon Mar 12, 2019
Could you open a separate ticket please, focused on that specific bug?
This is a tracking issue for the feature in general, and the feature in general was implemented and stabilized.