-
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
Stabilize by-value [T; N]
iterator core::array::IntoIter
#80470
Conversation
Tracking issue: rust-lang#65798 This is unblocked now that `min_const_generics` has been stabilized in rust-lang#79135. This PR does *not* include the corresponding `IntoIterator` impl, which is rust-lang#65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
r? @cramertj (rust-highfive has picked a reviewer for you, use r? to override) |
Stabilizing this iterator type with a @rfcbot fcp merge |
Ah I forgot I need to be in the checkboxy list to propose FCP. @rust-lang/libs please start the process for:
|
@rfcbot fcp merge |
Team member @m-ou-se 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. 🔔 |
Instead of having ::new, why not propose From for all stdlib iterators? |
Co-authored-by: Ashley Mannix <kodraus@hey.com>
@SoniEx2 I’m not sure what |
Instead of having an IntoIter::new(...), have an IntoIter::from(...) powered by trait From. This would be undeprecatable but it feels less silly and could be extended to the other iterators. Then you'd just use .into() and impl Iterator<Item=...>. // example usage
BTreeMap::<&'static str, &'static str>::from_iter([("a", "b")].into()) |
There’s no need to find another general pattern to turn collections into iterators, that’s the |
alternatively: the point is you'd use IntoIter::from() / [T; N].into() instead of [T; N].into_iter(). |
The job Click to see the possible cause of the failure (guessed by this bot)
|
This comment has been minimized.
This comment has been minimized.
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. The RFC will be merged soon. |
@bors r+ rollup |
📌 Commit 83d32b0 has been approved by |
…as-schievink Rollup of 18 pull requests Successful merges: - rust-lang#78044 (Implement io::Seek for io::Empty) - rust-lang#79285 (Stabilize Arc::{increment,decrement}_strong_count) - rust-lang#80053 (stabilise `cargo test -- --include-ignored`) - rust-lang#80279 (Implement missing `AsMut<str>` for `str`) - rust-lang#80470 (Stabilize by-value `[T; N]` iterator `core::array::IntoIter`) - rust-lang#80945 (Add Box::downcast() for dyn Any + Send + Sync) - rust-lang#81048 (Stabilize `core::slice::fill_with`) - rust-lang#81198 (Remove requirement that forces symmetric and transitive PartialEq impls to exist) - rust-lang#81422 (Account for existing `_` field pattern when suggesting `..`) - rust-lang#81472 (Clone entire `TokenCursor` when collecting tokens) - rust-lang#81484 (Optimize decimal formatting of 128-bit integers) - rust-lang#81491 (Balance sidebar `Deref` cycle check with main content) - rust-lang#81509 (Add a regression test for ICE of bad_placeholder_type) - rust-lang#81547 (Edit rustc_typeck top-level docs) - rust-lang#81550 (Replace predecessor with range in collections documentation) - rust-lang#81558 (Fix ascii art text wrapping in mobile) - rust-lang#81562 (Clarify that InPlaceIterable guarantees extend to all advancing iterator methods.) - rust-lang#81563 (Improve docblock readability on small screen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Drivers: rust-lang/rust#71395 rust-lang/rust#80470 needed by grcov
Drivers: rust-lang/rust#71395 rust-lang/rust#80470 needed by grcov
Tracking issue: #65798
This is unblocked now that
min_const_generics
has been stabilized in #79135.This PR does not include the corresponding
IntoIterator
impl, which is #65819. Instead, an iterator can be constructed through thenew
method.new
would become unnecessary whenIntoIterator
is implemented and might be deprecated then, although it will stay stable.