don't deprecate mem::{uninitialized,zeroed} just yet
This commit is contained in:
parent
7c37c6d33e
commit
ce8503d5af
1 changed files with 3 additions and 2 deletions
|
@ -514,7 +514,7 @@ pub fn needs_drop<T>() -> bool {
|
||||||
/// assert_eq!(0, x);
|
/// assert_eq!(0, x);
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_deprecated(since = "1.30.0", reason = "use `mem::MaybeUninit::zeroed` instead")]
|
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::zeroed` instead")]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub unsafe fn zeroed<T>() -> T {
|
pub unsafe fn zeroed<T>() -> T {
|
||||||
intrinsics::init()
|
intrinsics::init()
|
||||||
|
@ -609,7 +609,7 @@ pub unsafe fn zeroed<T>() -> T {
|
||||||
/// [copy_no]: ../intrinsics/fn.copy_nonoverlapping.html
|
/// [copy_no]: ../intrinsics/fn.copy_nonoverlapping.html
|
||||||
/// [`Drop`]: ../ops/trait.Drop.html
|
/// [`Drop`]: ../ops/trait.Drop.html
|
||||||
#[inline]
|
#[inline]
|
||||||
#[rustc_deprecated(since = "1.30.0", reason = "use `mem::MaybeUninit::uninitialized` instead")]
|
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::uninitialized` instead")]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub unsafe fn uninitialized<T>() -> T {
|
pub unsafe fn uninitialized<T>() -> T {
|
||||||
intrinsics::uninit()
|
intrinsics::uninit()
|
||||||
|
@ -1030,6 +1030,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
|
||||||
/// A newtype to construct uninitialized instances of `T`
|
/// A newtype to construct uninitialized instances of `T`
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
#[unstable(feature = "maybe_uninit", issue = "53491")]
|
#[unstable(feature = "maybe_uninit", issue = "53491")]
|
||||||
|
// NOTE after stabilizing `MaybeUninit` proceed to deprecate `mem::{uninitialized,zeroed}`
|
||||||
pub union MaybeUninit<T> {
|
pub union MaybeUninit<T> {
|
||||||
uninit: (),
|
uninit: (),
|
||||||
value: ManuallyDrop<T>,
|
value: ManuallyDrop<T>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue