Open
Description
Feature gate: #![feature(array_into_iter_constructors)]
This is a tracking issue for the from_raw_parts
new_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
- Implementation: Add
array::IntoIter::{empty, from_raw_parts}
#91341 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Should this be named
from_raw_parts
or something else? - Should this have to go through an
ArrayVec
-like type (like howVec
hasfrom_raw_parts
instead ofvec::IntoIter
having it), instead of making theIntoIter
directly? - What's a good name for
new_unchecked
? It was previouslyfrom_raw_parts
, but was changed at reviewer request in the initial PR. Then after that,new
was deprecated, which makes me feel likenew_unchecked
is a bit odd too.- Add
Iterator::next_chunk
#93700 (temporarily) added a duplicate of this calledwith_partial
, so that's another possible name.
- Add