-
Couldn't load subscription status.
- Fork 13.9k
Open
Labels
A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullA-sliceArea: `[T]`Area: `[T]`B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.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.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.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
This is a tracking issue for the RFC "Deprecate uninitialized in favor of a new MaybeUninit type" (rust-lang/rfcs#1892).
Most of this has been stabilized, this issue now only tracks the below unstable methods.
Public API
impl<T> [MaybeUninit<T>] {
pub unsafe fn assume_init_drop(&mut self);
pub const unsafe fn assume_init_ref(&self) -> &[T];
pub const unsafe fn assume_init_mut(&mut self) -> &mut [T];
pub const fn slice_as_ptr(this: &[MaybeUninit<T>]) -> *const T;
pub const fn slice_as_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T;
}Steps / History
- Implementation
- Make slice methods inherent: Add inherent versions of MaybeUninit methods for slices #129259
- Ensure documentation has examples
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- Should
slice_as_ptr/slice_as_mut_ptrbe methods (with someSelfparameter) instead of functions? slice_as_ptr/slice_as_mut_ptrget rid of the slice length, so.add(n)needs to be used on the result instead of a safer[n]. See accepted ACP RemoveMaybeUninit::slice_as_(mut_)ptrand optionally add*const/*mut MaybeUninit<T> -> *const/*mut Ttype safe conversions libs-team#245 and its incomplete implementation Nuke slice_as{,_mut}_ptr methods of MaybeUninit #103133
stanislav-tkach, coffeenotfound, paolobarbolini, YangKeao, kornelski and 10 more
Metadata
Metadata
Assignees
Labels
A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullA-sliceArea: `[T]`Area: `[T]`B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.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.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.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.