Open rustbot opened 2 hours ago
We actually basically stabilized the entire feature, honestly, as it was originally conceived.
If you want to keep it short you could phrase it like this:
AllocationType::new_uninit()
and AllocationType::new_uninit_slice()
for each dereferenceable allocation type or "smart pointer" (Box, Rc, and Arc), and the corresponding assume_init
s.But you could jam in the entire list of new fn if you feel the blog post needs padding:
impl<T> Box<T> { pub fn new_uninit() -> Box<MaybeUninit<T>> {…} }
impl<T> Rc<T> { pub fn new_uninit() -> Rc<MaybeUninit<T>> {…} }
impl<T> Arc<T> { pub fn new_uninit() -> Arc<MaybeUninit<T>> {…} }
impl<T> Box<[T]> { pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} }
impl<T> Rc<[T]> { pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} }
impl<T> Arc<[T]> { pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} }
impl<T> Box<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Box<T> {…} }
impl<T> Box<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Box<[T]> {…} }
impl<T> Rc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Rc<T> {…} }
impl<T> Rc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Rc<[T]> {…} }
impl<T> Arc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Arc<T> {…} }
impl<T> Arc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Arc<[T]> {…} }
It was a "partial" stabilization because after the feature was proposed a bunch of PRs were landed that added a zillion extra functions to be stabilized with it, and there wasn't consensus for stabilizing those also yet. So they weren't.
This issue tracks the release notes text for #129401.
Steps
Release notes text
The responsible team for the underlying change should edit this section to replace the automatically generated link with a succinct description of what changed, drawing upon text proposed by the author (either in discussion or through direct editing).
Release blog section
If the change is notable enough for inclusion in the blog post, the responsible team should add content to this section. Otherwise leave it empty.
cc @workingjubilee, @dtolnay -- origin issue/PR authors and assignees for starting to draft text