-
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
Implement IntoIterator
for [&[mut]] Box<[T; N], A>
#134021
base: master
Are you sure you want to change the base?
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.
☔ The latest upstream changes (presumably #136572) made this pull request unmergeable. Please resolve the merge conflicts. |
/// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>;
Revival of #124108
I copied the
<[T; N] as IntoIterator>::Iter
's impl, but this does not seem satisfying:IndexRange
publicr? @scottmcm
maybe you have better implementation ideas.