rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.07k stars 12.54k forks source link

Tracking issue for release notes of #129401: Partially stabilize `feature(new_uninit)` #130794

Open rustbot opened 2 hours ago

rustbot commented 2 hours ago

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).

# Category (e.g. Language, Compiler, Libraries, Compatibility notes, ...)
- [Partially stabilize `feature(new_uninit)`](https://github.com/rust-lang/rust/pull/129401)

[!TIP] Use the previous releases categories to help choose which one(s) to use. The category will be de-duplicated with all the other ones by the release team.

More than one section can be included if needed.

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

workingjubilee commented 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:

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.