Implement IntoIterator for [&[mut]] Box<[T; N], A>#134021
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6f3a44b to
576e704
Compare
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #136572) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@scottmcm anything I can do to move this forward? |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
6bcd9c3 to
72ea626
Compare
This comment has been minimized.
This comment has been minimized.
72ea626 to
366152c
Compare
This comment has been minimized.
This comment has been minimized.
33ce55c to
a26c96f
Compare
No, we aren't missing any impls, since I added all of them :) Also, this PR is compatible with the unsizing idea, with that you would have: struct AllocatedContinuousIntoIter<T: ?Sized, A: Allocator = Global> { ... } // name bikeshedable
type vec::IntoIter<T, A: Allocator> = AllocatedContinuousIntoIter<[T], A>;
type box::BoxedArrayIntoIter<T, const N: usize, A: Allocator> = AllocatedContinuousIntoIter<[T; N], A>;Note that I.e. one of two follow ups is possible:
|
|
@rfcbot merge libs-api |
|
@Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns: 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. |
|
|
||
| fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> { | ||
| self.inner.advance_by(n) | ||
| } |
There was a problem hiding this comment.
It looks like we're missing overrides for next_chunk, try_fold, and probably __iterator_get_unchecked? Those are 'just' perf optimizations though.
I think the best way to fix this long-term is the change to have a common iterator type rather than duplicating all the surface area.
f65b35f to
5d3dba6
Compare
This comment has been minimized.
This comment has been minimized.
| /// A by-value `Box<[T; N]>` iterator. | ||
| #[stable(feature = "boxed_array_value_iter", since = "CURRENT_RUSTC_VERSION")] | ||
| #[rustc_insignificant_dtor] | ||
| pub struct BoxedArrayIntoIter<T, const N: usize, A: Allocator = Global> { |
There was a problem hiding this comment.
can you add Default for BoxedArrayIntoIter<...> that gives an empty iterator just like vec::IntoIter and array::IntoIter?
There was a problem hiding this comment.
I don't want to change what the FCP is about, so maybe this should be left as a follow up?
|
Given the potential for breaking changes here, it seems prudent to do a crater run. I don't see that one has been done. Thoughts on doing so? @rfcbot concern crater |
…>` and `[T; N]` They'll be needed for `IntoIterator` impls.
Note: this removes warnings, as this breakage was deemed acceptable, see <rust-lang#124108 (comment)>
5d3dba6 to
6bf1d93
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@BurntSushi doing a crater run seems reasonable to me. I'll start it once the try build completes. @bors try |
Implement `IntoIterator` for `[&[mut]] Box<[T; N], A>`
This comment has been minimized.
This comment has been minimized.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
View all comments
Revival of #124108