Tracking Issue for alloc_slice_into_array. (original) (raw)
Feature gate: #![feature(alloc_slice_into_array)]
Branched from: #133508
This is a tracking issue for adding conversion functions going from allocated slices to allocated arrays.
Public API
// alloc::boxed
impl Box<[T]> { pub fn into_array(self) -> Result<Box<[T; N]>, Self>; }
// alloc::rc
impl Rc<[T]> { pub fn into_array(self) -> Result<Rc<[T; N]>, Self>; }
// alloc::sync
impl Arc<[T]> { pub fn into_array(self) -> Result<Arc<[T; N]>, Self>; }
Steps / History
- API change proposal (ACP): #496
- Implementation:
- Implementation for
Box<[_]>,Rc<[_]>, andArc<[_]>: Add into_array conversion destructors for Box, Rc, and Arc. #134379 - Update feature gates and tracking issues in source: Stabilise as_array in [_] and *const [_]; stabilise as_mut_array in [_] and *mut [_]. #147540
- Reimplementation for using
ResultinBox<[_]>,Rc<[_]>, andArc<[_]>
- Implementation for
- Final comment period (FCP)
- Stabilisation
Unresolved Questions
const-compatibility?:OptionorResult?Result(assumed).- Implementations for
MutexandRwLock? Vec::into_boxed_array?String::into_boxed_bytes_array?