library: Stabilize new_uninit for Box, Rc, and Arc

A partial stabilization that only affects:
- AllocType<T>::new_uninit
- AllocType<T>::assume_init
- AllocType<[T]>::new_uninit_slice
- AllocType<[T]>::assume_init
where "AllocType" is Box, Rc, or Arc
This commit is contained in:
Jubilee Young 2024-08-21 22:22:18 -07:00
parent 600edc948a
commit 169b2f0e6d
7 changed files with 32 additions and 67 deletions

View File

@ -262,8 +262,6 @@ pub fn new(x: T) -> Self {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
///
/// let mut five = Box::<u32>::new_uninit(); /// let mut five = Box::<u32>::new_uninit();
/// ///
/// let five = unsafe { /// let five = unsafe {
@ -276,7 +274,7 @@ pub fn new(x: T) -> Self {
/// assert_eq!(*five, 5) /// assert_eq!(*five, 5)
/// ``` /// ```
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use] #[must_use]
#[inline] #[inline]
pub fn new_uninit() -> Box<mem::MaybeUninit<T>> { pub fn new_uninit() -> Box<mem::MaybeUninit<T>> {
@ -292,7 +290,6 @@ pub fn new_uninit() -> Box<mem::MaybeUninit<T>> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(new_zeroed_alloc)] /// #![feature(new_zeroed_alloc)]
/// ///
/// let zero = Box::<u32>::new_zeroed(); /// let zero = Box::<u32>::new_zeroed();
@ -350,7 +347,7 @@ pub fn try_new(x: T) -> Result<Self, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// let mut five = Box::<u32>::try_new_uninit()?; /// let mut five = Box::<u32>::try_new_uninit()?;
/// ///
@ -380,7 +377,7 @@ pub fn try_new_uninit() -> Result<Box<mem::MaybeUninit<T>>, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// let zero = Box::<u32>::try_new_zeroed()?; /// let zero = Box::<u32>::try_new_zeroed()?;
/// let zero = unsafe { zero.assume_init() }; /// let zero = unsafe { zero.assume_init() };
@ -460,7 +457,7 @@ pub fn try_new_in(x: T, alloc: A) -> Result<Self, AllocError>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -498,7 +495,7 @@ pub fn new_uninit_in(alloc: A) -> Box<mem::MaybeUninit<T>, A>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -538,7 +535,7 @@ pub fn try_new_uninit_in(alloc: A) -> Result<Box<mem::MaybeUninit<T>, A>, AllocE
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -576,7 +573,7 @@ pub fn new_zeroed_in(alloc: A) -> Box<mem::MaybeUninit<T>, A>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -654,8 +651,6 @@ impl<T> Box<[T]> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
///
/// let mut values = Box::<[u32]>::new_uninit_slice(3); /// let mut values = Box::<[u32]>::new_uninit_slice(3);
/// ///
/// let values = unsafe { /// let values = unsafe {
@ -670,7 +665,7 @@ impl<T> Box<[T]> {
/// assert_eq!(*values, [1, 2, 3]) /// assert_eq!(*values, [1, 2, 3])
/// ``` /// ```
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use] #[must_use]
pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> { pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
unsafe { RawVec::with_capacity(len).into_box(len) } unsafe { RawVec::with_capacity(len).into_box(len) }
@ -686,7 +681,6 @@ pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
/// ///
/// ``` /// ```
/// #![feature(new_zeroed_alloc)] /// #![feature(new_zeroed_alloc)]
/// #![feature(new_uninit)]
/// ///
/// let values = Box::<[u32]>::new_zeroed_slice(3); /// let values = Box::<[u32]>::new_zeroed_slice(3);
/// let values = unsafe { values.assume_init() }; /// let values = unsafe { values.assume_init() };
@ -708,7 +702,7 @@ pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// let mut values = Box::<[u32]>::try_new_uninit_slice(3)?; /// let mut values = Box::<[u32]>::try_new_uninit_slice(3)?;
/// let values = unsafe { /// let values = unsafe {
@ -746,7 +740,7 @@ pub fn try_new_uninit_slice(len: usize) -> Result<Box<[mem::MaybeUninit<T>]>, Al
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// let values = Box::<[u32]>::try_new_zeroed_slice(3)?; /// let values = Box::<[u32]>::try_new_zeroed_slice(3)?;
/// let values = unsafe { values.assume_init() }; /// let values = unsafe { values.assume_init() };
@ -778,7 +772,7 @@ impl<T, A: Allocator> Box<[T], A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -812,7 +806,7 @@ pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -837,7 +831,7 @@ pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -880,7 +874,7 @@ pub fn try_new_uninit_slice_in(
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::alloc::System; /// use std::alloc::System;
/// ///
@ -927,8 +921,6 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
///
/// let mut five = Box::<u32>::new_uninit(); /// let mut five = Box::<u32>::new_uninit();
/// ///
/// let five: Box<u32> = unsafe { /// let five: Box<u32> = unsafe {
@ -940,7 +932,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
/// ///
/// assert_eq!(*five, 5) /// assert_eq!(*five, 5)
/// ``` /// ```
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[inline] #[inline]
pub unsafe fn assume_init(self) -> Box<T, A> { pub unsafe fn assume_init(self) -> Box<T, A> {
let (raw, alloc) = Box::into_raw_with_allocator(self); let (raw, alloc) = Box::into_raw_with_allocator(self);
@ -958,7 +950,6 @@ pub unsafe fn assume_init(self) -> Box<T, A> {
/// ///
/// ``` /// ```
/// #![feature(box_uninit_write)] /// #![feature(box_uninit_write)]
/// #![feature(new_uninit)]
/// ///
/// let big_box = Box::<[usize; 1024]>::new_uninit(); /// let big_box = Box::<[usize; 1024]>::new_uninit();
/// ///
@ -1001,8 +992,6 @@ impl<T, A: Allocator> Box<[mem::MaybeUninit<T>], A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
///
/// let mut values = Box::<[u32]>::new_uninit_slice(3); /// let mut values = Box::<[u32]>::new_uninit_slice(3);
/// ///
/// let values = unsafe { /// let values = unsafe {
@ -1016,7 +1005,7 @@ impl<T, A: Allocator> Box<[mem::MaybeUninit<T>], A> {
/// ///
/// assert_eq!(*values, [1, 2, 3]) /// assert_eq!(*values, [1, 2, 3])
/// ``` /// ```
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[inline] #[inline]
pub unsafe fn assume_init(self) -> Box<[T], A> { pub unsafe fn assume_init(self) -> Box<[T], A> {
let (raw, alloc) = Box::into_raw_with_allocator(self); let (raw, alloc) = Box::into_raw_with_allocator(self);

View File

@ -93,7 +93,6 @@
// tidy-alphabetical-start // tidy-alphabetical-start
#![cfg_attr(not(no_global_oom_handling), feature(const_alloc_error))] #![cfg_attr(not(no_global_oom_handling), feature(const_alloc_error))]
#![cfg_attr(not(no_global_oom_handling), feature(const_btree_len))] #![cfg_attr(not(no_global_oom_handling), feature(const_btree_len))]
#![cfg_attr(test, feature(new_uninit))]
#![feature(alloc_layout_extra)] #![feature(alloc_layout_extra)]
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(array_chunks)] #![feature(array_chunks)]

View File

@ -503,7 +503,6 @@ pub fn new_cyclic<F>(data_fn: F) -> Rc<T>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -518,7 +517,7 @@ pub fn new_cyclic<F>(data_fn: F) -> Rc<T>
/// assert_eq!(*five, 5) /// assert_eq!(*five, 5)
/// ``` /// ```
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use] #[must_use]
pub fn new_uninit() -> Rc<mem::MaybeUninit<T>> { pub fn new_uninit() -> Rc<mem::MaybeUninit<T>> {
unsafe { unsafe {
@ -540,7 +539,6 @@ pub fn new_uninit() -> Rc<mem::MaybeUninit<T>> {
/// ///
/// ``` /// ```
/// #![feature(new_zeroed_alloc)] /// #![feature(new_zeroed_alloc)]
/// #![feature(new_uninit)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
/// ///
@ -594,7 +592,7 @@ pub fn try_new(value: T) -> Result<Rc<T>, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -630,7 +628,7 @@ pub fn try_new_uninit() -> Result<Rc<mem::MaybeUninit<T>>, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
/// ///
@ -692,7 +690,6 @@ pub fn new_in(value: T, alloc: A) -> Rc<T, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
@ -736,7 +733,6 @@ pub fn new_uninit_in(alloc: A) -> Rc<mem::MaybeUninit<T>, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -799,7 +795,7 @@ pub fn try_new_in(value: T, alloc: A) -> Result<Self, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -843,7 +839,7 @@ pub fn try_new_uninit_in(alloc: A) -> Result<Rc<mem::MaybeUninit<T>, A>, AllocEr
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(allocator_api, new_uninit)] /// #![feature(allocator_api)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
/// use std::alloc::System; /// use std::alloc::System;
@ -967,7 +963,6 @@ impl<T> Rc<[T]> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -985,7 +980,7 @@ impl<T> Rc<[T]> {
/// assert_eq!(*values, [1, 2, 3]) /// assert_eq!(*values, [1, 2, 3])
/// ``` /// ```
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use] #[must_use]
pub fn new_uninit_slice(len: usize) -> Rc<[mem::MaybeUninit<T>]> { pub fn new_uninit_slice(len: usize) -> Rc<[mem::MaybeUninit<T>]> {
unsafe { Rc::from_ptr(Rc::allocate_for_slice(len)) } unsafe { Rc::from_ptr(Rc::allocate_for_slice(len)) }
@ -1000,7 +995,6 @@ pub fn new_uninit_slice(len: usize) -> Rc<[mem::MaybeUninit<T>]> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(new_zeroed_alloc)] /// #![feature(new_zeroed_alloc)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -1035,7 +1029,6 @@ impl<T, A: Allocator> Rc<[T], A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
@ -1072,7 +1065,6 @@ pub fn new_uninit_slice_in(len: usize, alloc: A) -> Rc<[mem::MaybeUninit<T>], A>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -1122,7 +1114,6 @@ impl<T, A: Allocator> Rc<mem::MaybeUninit<T>, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -1136,7 +1127,7 @@ impl<T, A: Allocator> Rc<mem::MaybeUninit<T>, A> {
/// ///
/// assert_eq!(*five, 5) /// assert_eq!(*five, 5)
/// ``` /// ```
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[inline] #[inline]
pub unsafe fn assume_init(self) -> Rc<T, A> { pub unsafe fn assume_init(self) -> Rc<T, A> {
let (ptr, alloc) = Rc::into_inner_with_allocator(self); let (ptr, alloc) = Rc::into_inner_with_allocator(self);
@ -1160,7 +1151,6 @@ impl<T, A: Allocator> Rc<[mem::MaybeUninit<T>], A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::rc::Rc; /// use std::rc::Rc;
@ -1177,7 +1167,7 @@ impl<T, A: Allocator> Rc<[mem::MaybeUninit<T>], A> {
/// ///
/// assert_eq!(*values, [1, 2, 3]) /// assert_eq!(*values, [1, 2, 3])
/// ``` /// ```
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[inline] #[inline]
pub unsafe fn assume_init(self) -> Rc<[T], A> { pub unsafe fn assume_init(self) -> Rc<[T], A> {
let (ptr, alloc) = Rc::into_inner_with_allocator(self); let (ptr, alloc) = Rc::into_inner_with_allocator(self);

View File

@ -505,7 +505,6 @@ pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -521,7 +520,7 @@ pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
/// ``` /// ```
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[inline] #[inline]
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use] #[must_use]
pub fn new_uninit() -> Arc<mem::MaybeUninit<T>> { pub fn new_uninit() -> Arc<mem::MaybeUninit<T>> {
unsafe { unsafe {
@ -543,7 +542,6 @@ pub fn new_uninit() -> Arc<mem::MaybeUninit<T>> {
/// ///
/// ``` /// ```
/// #![feature(new_zeroed_alloc)] /// #![feature(new_zeroed_alloc)]
/// #![feature(new_uninit)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
/// ///
@ -614,7 +612,7 @@ pub fn try_new(data: T) -> Result<Arc<T>, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit, allocator_api)] /// #![feature(allocator_api)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -650,7 +648,7 @@ pub fn try_new_uninit() -> Result<Arc<mem::MaybeUninit<T>>, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit, allocator_api)] /// #![feature( allocator_api)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
/// ///
@ -711,7 +709,6 @@ pub fn new_in(data: T, alloc: A) -> Arc<T, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
@ -755,7 +752,6 @@ pub fn new_uninit_in(alloc: A) -> Arc<mem::MaybeUninit<T>, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -845,7 +841,7 @@ pub fn try_new_in(data: T, alloc: A) -> Result<Arc<T, A>, AllocError> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit, allocator_api)] /// #![feature(allocator_api)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -889,7 +885,7 @@ pub fn try_new_uninit_in(alloc: A) -> Result<Arc<mem::MaybeUninit<T>, A>, AllocE
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit, allocator_api)] /// #![feature(allocator_api)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
/// use std::alloc::System; /// use std::alloc::System;
@ -1101,7 +1097,6 @@ impl<T> Arc<[T]> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -1120,7 +1115,7 @@ impl<T> Arc<[T]> {
/// ``` /// ```
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
#[inline] #[inline]
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use] #[must_use]
pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]> { pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]> {
unsafe { Arc::from_ptr(Arc::allocate_for_slice(len)) } unsafe { Arc::from_ptr(Arc::allocate_for_slice(len)) }
@ -1136,7 +1131,6 @@ pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]> {
/// ///
/// ``` /// ```
/// #![feature(new_zeroed_alloc)] /// #![feature(new_zeroed_alloc)]
/// #![feature(new_uninit)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
/// ///
@ -1172,7 +1166,6 @@ impl<T, A: Allocator> Arc<[T], A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
@ -1208,7 +1201,6 @@ pub fn new_uninit_slice_in(len: usize, alloc: A) -> Arc<[mem::MaybeUninit<T>], A
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(allocator_api)] /// #![feature(allocator_api)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -1257,7 +1249,6 @@ impl<T, A: Allocator> Arc<mem::MaybeUninit<T>, A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -1271,7 +1262,7 @@ impl<T, A: Allocator> Arc<mem::MaybeUninit<T>, A> {
/// ///
/// assert_eq!(*five, 5) /// assert_eq!(*five, 5)
/// ``` /// ```
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "`self` will be dropped if the result is not used"] #[must_use = "`self` will be dropped if the result is not used"]
#[inline] #[inline]
pub unsafe fn assume_init(self) -> Arc<T, A> { pub unsafe fn assume_init(self) -> Arc<T, A> {
@ -1296,7 +1287,6 @@ impl<T, A: Allocator> Arc<[mem::MaybeUninit<T>], A> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(new_uninit)]
/// #![feature(get_mut_unchecked)] /// #![feature(get_mut_unchecked)]
/// ///
/// use std::sync::Arc; /// use std::sync::Arc;
@ -1313,7 +1303,7 @@ impl<T, A: Allocator> Arc<[mem::MaybeUninit<T>], A> {
/// ///
/// assert_eq!(*values, [1, 2, 3]) /// assert_eq!(*values, [1, 2, 3])
/// ``` /// ```
#[unstable(feature = "new_uninit", issue = "63291")] #[stable(feature = "new_uninit", since = "CURRENT_RUSTC_VERSION")]
#[must_use = "`self` will be dropped if the result is not used"] #[must_use = "`self` will be dropped if the result is not used"]
#[inline] #[inline]
pub unsafe fn assume_init(self) -> Arc<[T], A> { pub unsafe fn assume_init(self) -> Arc<[T], A> {

View File

@ -15,7 +15,6 @@
#![feature(exact_size_is_empty)] #![feature(exact_size_is_empty)]
#![feature(linked_list_cursors)] #![feature(linked_list_cursors)]
#![feature(map_try_insert)] #![feature(map_try_insert)]
#![feature(new_uninit)]
#![feature(pattern)] #![feature(pattern)]
#![feature(trusted_len)] #![feature(trusted_len)]
#![feature(try_reserve_kind)] #![feature(try_reserve_kind)]

View File

@ -28,7 +28,6 @@
#![feature(decl_macro)] #![feature(decl_macro)]
#![feature(maybe_uninit_write_slice)] #![feature(maybe_uninit_write_slice)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(new_uninit)]
#![feature(panic_can_unwind)] #![feature(panic_can_unwind)]
#![feature(restricted_std)] #![feature(restricted_std)]
#![feature(rustc_attrs)] #![feature(rustc_attrs)]

View File

@ -362,7 +362,6 @@
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(get_mut_unchecked)] #![feature(get_mut_unchecked)]
#![feature(map_try_insert)] #![feature(map_try_insert)]
#![feature(new_uninit)]
#![feature(new_zeroed_alloc)] #![feature(new_zeroed_alloc)]
#![feature(slice_concat_trait)] #![feature(slice_concat_trait)]
#![feature(thin_box)] #![feature(thin_box)]