Skip to content

Tracking Issue for additional array::IntoIter constructors (feature array_into_iter_constructors) #91583

Description

@scottmcm

Feature gate: #![feature(array_into_iter_constructors)]

This is a tracking issue for the from_raw_partsnew_unchecked and empty constructors on core::array::IntoIter.

This allows creating such an iterator with something other than a fully-initialized array.

Public API

// core::array

impl<T, const N: usize> IntoIter<T, N> {
    pub const fn empty() -> Self;
    pub const unsafe fn new_unchecked(buffer: [MaybeUninit<T>; N], initialized: Range<usize>) -> Self;
}

Steps / History

Unresolved Questions

  • Should this be named from_raw_parts or something else?
  • Should this have to go through an ArrayVec-like type (like how Vec has from_raw_parts instead of vec::IntoIter having it), instead of making the IntoIter directly?
  • What's a good name for new_unchecked? It was previously from_raw_parts, but was changed at reviewer request in the initial PR. Then after that, new was deprecated, which makes me feel like new_unchecked is a bit odd too.
  • Can new_unchecked take R: RangeBounds? To allow this to work with the new range types.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-arrayArea: `[T; N]`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions