Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sugar for bounds on associated types #1093

Closed
ftxqxd opened this issue Apr 27, 2015 · 5 comments
Closed

Add sugar for bounds on associated types #1093

ftxqxd opened this issue Apr 27, 2015 · 5 comments
Labels
T-lang Relevant to the language team, which will review and decide on the RFC.

Comments

@ftxqxd
Copy link
Contributor

ftxqxd commented Apr 27, 2015

It would be nice if where T: Trait<AssocType: Bound> were equivalent to where T: Trait, <T as Trait>::AssocType: Bound, by analogy with T: Trait<AssocType = Type>.

@nrc nrc added the T-lang Relevant to the language team, which will review and decide on the RFC. label Aug 30, 2016
@Twey
Copy link

Twey commented Oct 21, 2016

This, by introducing an implicit type variable, has consequences for bounds on associated-type parameters of associated types, where currently one needs to bubble the type information up to the outer trait and then use a projection bound to push it back down again:

trait Foo {
    type It: Iterator<Item: Iterator<Item=u8>>;
}

currently needs to be written as

trait Foo {
  type It2: Iterator<Item=u8>;
  type It: Iterator<Item=It2>;
}

@glaebhoerl
Copy link
Contributor

#2289

@Centril
Copy link
Contributor

Centril commented Jan 13, 2018

@P1start Can we close this now?

@glaebhoerl
Copy link
Contributor

I thought the informal protocol was to close after an RFC has been accepted.

@Centril
Copy link
Contributor

Centril commented Jan 13, 2018

(@glaebhoerl no idea - I don't want to overstep my bounds ^,-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-lang Relevant to the language team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

6 participants