-
Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
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> [T] {
pub const fn as_array<const N: usize>(&self) -> Option<&[T; N]>;
pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]>;
}
// core::ptr
impl<T> *const [T] {
pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]>;
}
impl<T> *mut [T] {
pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]>;
}Steps / History
- API change proposal (ACP): #496
- Implementation:
- ... for
[_],*const [_], and*mut [_]: Addas_arrayandas_mut_arrayconversion methods to slices. #133512 - Fix docs for
<[_]>::as_array: Fix docs for<[T]>::as_array. #133743
- ... for
- Final comment period (FCP)
- Stabilisation: Stabilise
as_arrayin[_]and*const [_]; stabiliseas_mut_arrayin[_]and*mut [_]. #147540
Unresolved Questions
: Will be moved to new tracking issue in due time.str::as_bytes_arrayandstr::as_bytes_array_mut?
joseluis, YYMMYB, cxw620, MathiasPius, TheNullicorn and 5 more
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.