Feature gate: #![feature(new_zeroed_alloc)]
Split-out from #63291 as a result of stabilizing most of its API! It's zeroed instead of uninit constructors, nothing too complicated!
Public API
It's new_zeroed and new_zeroed_slice on every major allocation type like Box, Rc, Arc.
impl<T> Box<T> { pub fn new_zeroed() -> Box<MaybeUninit<T>> {…} }
impl<T> Arc<T> { pub fn new_zeroed() -> Arc<MaybeUninit<T>> {…} }
impl<T> Rc<T> { pub fn new_zeroed() -> Rc<MaybeUninit<T>> {…} }
impl<[T]> Box<T> { pub fn new_zeroed_slice() -> Box<MaybeUninit<[T]>> {…} }
impl<[T]> Arc<T> { pub fn new_zeroed_slice() -> Arc<MaybeUninit<[T]>> {…} }
impl<[T]> Rc<T> { pub fn new_zeroed_slice() -> Rc<MaybeUninit<[T]>> {…} }
Steps / History
Unresolved Questions
Feature gate:
#![feature(new_zeroed_alloc)]Split-out from #63291 as a result of stabilizing most of its API! It's zeroed instead of uninit constructors, nothing too complicated!
Public API
It's
new_zeroedandnew_zeroed_sliceon every major allocation type like Box, Rc, Arc.Steps / History
Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩