- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Open
Labels
A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullC-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.
Description
Feature gate: #![feature(maybe_uninit_write_slice)]
This is a tracking issue for MaybeUninit::copy_from_slice and MaybeUninit::clone_from_slice.
These methods are the equivalents of [T]::copy_from_slice and [T]::clone_from_slice for uninitialized slices.
Public API
impl<T> [MaybeUninit<T>] {
    pub fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
    where
        T: Copy;
    pub fn write_clone_of_slice(&mut self, src: &[T]) -> &mut [T]
    where
        T: Clone;
}Steps / History
- Implementation: MaybeUninit::copy/clone_from_slice #79607
- Make slice methods inherent: Add inherent versions of MaybeUninit methods for slices #129259
- Stabilization PR
Unresolved Questions
-  Should the name be changed back to copy/clone_from_slice?- Reasoning for the original name and Revamp unstable MaybeUninit APIs libs-team#122
- Changed to copy_from_sliceandclone_from_slicein Rename MaybeUninit::write_slice #116385
- Changed again to write_copy_of_sliceandwrite_clone_of_slicein Add inherent versions of MaybeUninit methods for slices #129259
 
- MaybeUninit::write_slice_cloned() makes it very easy to accidentally leak #80376
zopsicle, stepancheg, That3Percent, Kixunil, s1ck and 6 more
Metadata
Metadata
Assignees
Labels
A-raw-pointersArea: raw pointers, MaybeUninit, NonNullArea: raw pointers, MaybeUninit, NonNullC-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.