-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
impl Default
for collection iterators that don't already have it
#128261
Conversation
This comment has been minimized.
This comment has been minimized.
This implements
These are trait impls and therefore instantly stable. @rfcbot fcp merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Implement Default for iterators See rust-lang/rust#128261 for a similar PR for some libstd iterators. In order to do a similar PR for the `HashSet` and `HashMap` types, we need to make these changes to `hashbrown` first to actually implement them. One small caveat is that I chose to only implement `Default` for `RawIter` and not `RawIterRange`, since it really exists as an implementation detail anyway, and the best implementation would involve just using the `RawIter` implementation anyway.
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
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!
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#128221 (Add implied target features to target_feature attribute) - rust-lang#128261 (impl `Default` for collection iterators that don't already have it) - rust-lang#128353 (Change generate-copyright to generate HTML, with cargo dependencies included) - rust-lang#128679 (codegen: better centralize function declaration attribute computation) - rust-lang#128732 (make `import.vis` is immutable) - rust-lang#128755 (Integrate crlf directly into related test file instead via of .gitattributes) - rust-lang#128772 (rustc_codegen_ssa: Set architecture for object crate for 32-bit SPARC) - rust-lang#128782 (unused_parens: do not lint against parens around &raw) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128261 - clarfonthey:iter-default, r=dtolnay impl `Default` for collection iterators that don't already have it There is a pretty strong precedent for implementing `Default` for collection iterators, and this does so for some where this implementation was missed. I don't think this needs a separate ACP (since this precedent already exists, and these feel like they were just missed), however, it *will* need an FCP since these implementations are instantly stable.
…olnay impl `Default` for `HashMap`/`HashSet` iterators that don't already have it This is a follow-up to rust-lang#128261 that isn't included in that PR because it depends on: * [x] rust-lang/hashbrown#542 (`Default`) * [x] `hashbrown` release containing above It also wasn't included in rust-lang#128261 initially and should have its own FCP, since these are also insta-stable. Changes added: * `Default for hash_map::{Iter, IterMut, IntoIter, IntoKeys, IntoValues, Keys, Values, ValuesMut}` * `Default for hash_set::{Iter, IntoIter}` Changes that were added before FCP, but are being deferred to later: * `Clone for hash_map::{IntoIter, IntoKeys, IntoValues} where K: Clone, V: Clone` * `Clone for hash_set::IntoIter where K: Clone`
There is a pretty strong precedent for implementing
Default
for collection iterators, and this does so for some where this implementation was missed.I don't think this needs a separate ACP (since this precedent already exists, and these feel like they were just missed), however, it will need an FCP since these implementations are instantly stable.