Skip to content

Tracking Issue for alloc_slice_into_array. #148082

Open

Description

@bjoernager

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

Unresolved Questions

  • const-compatibility?
  • Option or Result? : Result (assumed.)
  • Implementations for Mutex and RwLock?
  • Vec::into_boxed_array?
  • String::into_boxed_bytes_array?

Activity

  1. added
    T-libs-api[DEPRECATED; DO NOT USE]
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Oct 24, 2025
  2. changed the title [-]Tracking Issue for `alloc_slice_as_array`.[/-] [+]Tracking Issue for `alloc_slice_into_array`.[/+] on Oct 24, 2025
  3. added 2 commits that reference this issue on Apr 11, 2026
  4. added a commit that references this issue on Apr 12, 2026
  5. added a commit that references this issue on May 24, 2026
  6. added a commit that references this issue on May 24, 2026
  7. added 2 commits that reference this issue on Jun 26, 2026
  8. added a commit that references this issue on Jun 27, 2026
  9. added
    T-libsRelevant to the library team, which will review and decide on the PR/issue.
    and removed
    T-libs-api[DEPRECATED; DO NOT USE]
    on Aug 12, 2026
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

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-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