-
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 RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-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.
Description
Feature gate: #![feature(ptr_cast_slice)]
This is a tracking issue for rust-lang/libs-team#693
This feature adds method calls on raw pointers that call into the respective ptr::slice_from_raw_parts{_mut} method for the types *const T, *mut T and NonNull<T> to make using raw pointers more ergonomic in Rust by supporting postfix method chain syntax while creating slices.
Public API
// core::ptr::const_ptr
impl<T> *const T {
pub const fn cast_slice(self, len: usize) -> *const [T];
}
// core::ptr::mut_ptr
impl<T> *mut T {
pub const fn cast_slice(self, len: usize) -> *mut [T];
}
// core::ptr::non_null
impl<T> NonNull<T> {
pub const fn cast_slice(self, len: usize) -> NonNull<[T]>;
}Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: rust-lang/libs-team#693
- Implementation: Implement
cast_slicefor raw pointer types #149110 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
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 RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-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.