Tracking Issue for `alloc_slice_into_array`.
Open
Nobody has claimed this yet.
C-tracking-issue
S-tracking-unimplemented
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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<T> Box<[T]> {
pub fn into_array<const N: usize>(self) -> Result<Box<[T; N]>, Self>;
}
// alloc::rc
impl<T> Rc<[T]> {
pub fn into_array<const N: usize>(self) -> Result<Rc<[T; N]>, Self>;
}
// alloc::sync
impl<T> Arc<[T]> {
pub fn into_array<const N: usize>(self) -> Result<Arc<[T; N]>, Self>;
}
// alloc::vec
impl<T> Vec<T> {
pub fn into_array<const N: usize>(self) -> Result<Box<[T; N]>, Self>;
}
Steps / History
- API change proposal (ACP): #496
- Implementation:
- Implementation for
Box<[_]>,Rc<[_]>, andArc<[_]>: #134379 - Update feature gates and tracking issues in source: #147540
- Support custom allocators: #154925
- Reimplementation for using
Resultinstead ofOption: #156810 - Implementation for
Vec<_>: #156234
- 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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the API change proposal #496 and the implementation PRs #134379, #154925, #156810, and #156234. Check the unresolved questions and the current feature-gate state; completion requires resolving the remaining design questions, holding the final comment period, and stabilizing the APIs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100