-
Notifications
You must be signed in to change notification settings - Fork 25
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
Added .pop() to Chan as a complete alternative to .succ() and .zero(). #26
base: master
Are you sure you want to change the base?
Conversation
One thing I have not tested is how far the compiler is willing to resolve this recursively, though I'm sure similar issues pop up anyway with highly recursive protocols. |
@@ -370,7 +395,7 @@ pub struct ChanSelect<'c, T> { | |||
} | |||
|
|||
|
|||
impl<'c, T> ChanSelect<'c, T> { | |||
impl<'c, T: 'c> ChanSelect<'c, T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a warning that will become a hard error in the next stable release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
I like this - IMO it's mostly an ergonomics thing, but it still adds value. 👍 |
Yeah, I like this too. One thing that might be a concern is if error messages get polluted with |
I understand this a little better now - EDIT: This sounds like a really silly question in hindsight... |
type Tail = (A, B); | ||
} | ||
|
||
impl<A, B: Pop<N>, N> Pop<S<N>> for (A, B) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How well are trait impls for tuples supported? We did this once and found out that it was a bit of an unstable feature - but that might have been at that time...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's available in stable. :) Might have been an issue before the major coherence changes earlier this year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it could be done with associated types like we're using for Send, Recv, etc.?
.pop()
will automatically bring the type upward from the "recursive" depth indicated byVar<N>
, obviating the need for.succ().succ().succ().zero()
or similar things.Closes #25