Tracking Issue for core_slice_as_array. (original) (raw)

Feature gate: #![feature(core_slice_as_array)]

This is a tracking issue for adding conversion functions going from slices to arrays.

This tracking issue has been branched into #148082.

Public API

// core::slice

impl [T] { pub const fn as_array(&self) -> Option<&[T; N]>;

pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]>;

}

// core::ptr

impl *const [T] { pub const fn as_array(self) -> Option<*const [T; N]>; }

impl *mut [T] { pub const fn as_mut_array(self) -> Option<*mut [T; N]>; }

Steps / History

Unresolved Questions