-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Ensure Extend is implemented and renamed Extendable to Extend #18475
Conversation
This seems to also add |
Oh, no, I'm just dumb: that's the vim syntax file. sidles away |
:p |
@@ -74,8 +74,8 @@ pub trait FromIterator<A> { | |||
} | |||
|
|||
/// A type growable from an `Iterator` implementation | |||
pub trait Extendable<A>: FromIterator<A> { | |||
/// Extend a container with the elements yielded by an iterator | |||
pub trait Extend<A>: { |
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.
You should be able to drop the extra colon here
Awesome work, thanks @gamazeps! Could you also do these two things?
Other than that I think this is good to go! |
23c2119
to
cd3c88b
Compare
Could you leave the |
Done :) |
@alexcrichton does it need a rebase, or can I simply ask bors to retry ? |
Yeah this just needs to be rebased against master and then it's god to go again. |
@alexcrichton Done :) (teh rebase was awfull ^^) |
@bors retry |
@gamazeps the error looks legit:
|
@gankro, yep I realised it just after the retry ^^ |
In order to upgrade, simply rename the Extendable trait to Extend in your code Part of rust-lang#18424 [breaking-change]
Fixed it :) |
Ensured that Extend & FromIterator are implemented for the libcollection. Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache). Changed the name from Extend to Extendable. Part of #18424
|
CC @aturon, this is a change we made because not all Extendables can be constructed FromIterators (need extra args to be constructed). Not sure if the RFC needs to be updated, but I'm also not sure if we ever ran this past you. |
This is a fine change. @forkloop, can you please add a comment to the tracking issue about this change? We'll file an amendment to the RFC after we've collected all the implementation tweaks. |
I added a comment in the tracking issue, thanks a lot for the work! |
Support new #[rustc_intrinsic] attribute and fallback bodies
Ensured that Extend & FromIterator are implemented for the libcollection.
Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache).
Changed the name from Extend to Extendable.
Part of #18424