-
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.
Description
Feature gate: #![feature(maybe_uninit_fill)]
This is a tracking issue for ACP rust-lang/libs-team#156
Public API
// core::mem
impl<T> MaybeUninit<T> {
pub fn fill<'a>(this: &'a mut [MaybeUninit<T>], value: T) -> &'a mut [T]
where
T: Clone;
pub fn fill_with<'a, F>(this: &'a mut [MaybeUninit<T>], mut f: F) -> &'a mut [T]
where
F: FnMut() -> T;
pub fn fill_from<'a, I>(
this: &'a mut [MaybeUninit<T>],
it: I,
) -> (&'a mut [T], &'a mut [MaybeUninit<T>])
where
I: IntoIterator<Item = T>;
}Steps / History
- Implementation: Implement
MaybeUninit::fill{,_cloned,_mut,_with,_from}#117426, Implement MaybeUninit::fill{,_with,_from} #121280 - Make slice methods inherent:
MaybeUninitinherent slice methods part 2 #135394 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Naming: these were originally named
fill,fill_with, andfill_fromto be consistent consistent withslice::{fill_with,fill_from}. Since changing to slice-inherent methods, these needed to be renamed to avoid conflict. Should we change to naming that keepsfill? Amanieu suggestedfill_initat Add inherent versions of MaybeUninit methods for slices #129259 (comment).
Footnotes
nazar-pcyotamofekNN---
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.