Skip to content

Conversation

@WaffleLapkin
Copy link
Member

Revival of #124108

I copied the <[T; N] as IntoIterator>::Iter's impl, but this does not seem satisfying:

  1. I had to make IndexRange public
  2. this duplicates a lot of code
  3. it's unclear if the copied unsafe and spec code is worth it

r? @scottmcm
maybe you have better implementation ideas.

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.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 8, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

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)
@rust-log-analyzer

This comment has been minimized.

@tgross35 tgross35 added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Dec 13, 2024
@WaffleLapkin WaffleLapkin marked this pull request as ready for review December 16, 2024 19:24
@tgross35 tgross35 added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Dec 19, 2024
@bors
Copy link
Collaborator

bors commented Feb 6, 2025

☔ 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> {
Copy link
Member

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>;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about it again, I think we should merge this as-is. We can always make an abstraction like you suggest later. @rustbot review

@Dylan-DPC Dylan-DPC added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2025
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 14, 2025
@WaffleLapkin
Copy link
Member Author

@scottmcm anything I can do to move this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants