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
P1start opened this Issue Apr 27, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@P1start
Copy link
Contributor

P1start 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 label Aug 30, 2016

@Twey

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

glaebhoerl commented Jan 13, 2018

#2289

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Jan 13, 2018

@P1start Can we close this now?

@glaebhoerl

This comment has been minimized.

Copy link
Contributor

glaebhoerl commented Jan 13, 2018

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

@Centril

This comment has been minimized.

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
You can’t perform that action at this time.