Open
Description
opened on Oct 31, 2023
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>] {
// formerly `fill`
pub fn write_filled<'a>(this: &'a mut [MaybeUninit<T>], value: T) -> &'a mut [T]
where T: Clone
// formerly `fill_with`
pub fn write_with<'a, F>(this: &'a mut [MaybeUninit<T>], f: F) -> &'a mut [T]
where F: FnMut() -> T;
// formerly `fill_from`
pub fn write_iter<'a, I>(this: &'a mut [MaybeUninit<T>], iter: I) -> (&'a mut [T], &'a mut [MaybeUninit<T>])
where I: Iterator<Item = T>;
}
Steps / History
- Implementation: Implement
MaybeUninit::fill{,_cloned,_mut,_with,_from}
#117426 - Make slice methods inherent: Add inherent versions of MaybeUninit methods for slices #129259
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Naming: these were originally named
fill
,fill_with
, andfill_from
to 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_init
at Add inherent versions of MaybeUninit methods for slices #129259 (comment).
Activity