Implement IntoIterator for [&[mut]] Box<[T; N], A>#134021
Open
WaffleLapkin wants to merge 8 commits intorust-lang:mainfrom
Open
Implement IntoIterator for [&[mut]] Box<[T; N], A>#134021WaffleLapkin wants to merge 8 commits intorust-lang:mainfrom
IntoIterator for [&[mut]] Box<[T; N], A>#134021WaffleLapkin wants to merge 8 commits intorust-lang:mainfrom
Conversation
Specifically make it public + unstable under `std_internals` + `doc(hidden)`. This is honestly Not Great, but I do not know a better solution :(
…>` and `[T; N]` They'll be needed for `IntoIterator` impls.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Note: this removes warnings, as this breakage was deemed acceptable, see <rust-lang#124108 (comment)>
i forgot that `#![doc(hidden)]` applies to the module, not everything in it... again. (this caused linkchecker to fail, because of a debug impl)
6f3a44b to
576e704
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
|
☔ The latest upstream changes (presumably #136572) made this pull request unmergeable. Please resolve the merge conflicts. |
scottmcm
reviewed
Feb 24, 2025
| /// 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> { |
Member
There was a problem hiding this comment.
The only thing I was thinking that might possibly work to avoid the duplication would be something like this ancient experiment that I never really took anywhere: 8e6c148
Basically, have
type BoxedArrayIntoIter<T, const N: usize, A: Allocator = Global> = InternalVecOrBoxedArrayIntoIter<T, FixedCapacity<N>, A>;
type vec::IntoIter<T, A: Allocator = Global> = InternalVecOrBoxedArrayIntoIter<T, Cap, A>;
Member
Author
There was a problem hiding this comment.
Thinking about it again, I think we should merge this as-is. We can always make an abstraction like you suggest later. @rustbot review
Member
Author
|
@scottmcm anything I can do to move this forward? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revival of #124108
I copied the
<[T; N] as IntoIterator>::Iter's impl, but this does not seem satisfying:IndexRangepublicr? @scottmcm
maybe you have better implementation ideas.