Skip to content

Tracking Issue for alloc_slice_into_array. #148082

@bjoernager

Description

@bjoernager

Feature gate: #![feature(alloc_slice_into_array)]

Original tracking issue: #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>;
}

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?

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-libs-apiRelevant to the library API 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