Skip to content

Commit daccd99

Browse files
committed
stabilize maybe_uninit_slice
1 parent 7b9905e commit daccd99

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

library/core/src/mem/maybe_uninit.rs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,20 +1097,6 @@ impl<T> MaybeUninit<T> {
10971097
)
10981098
}
10991099
}
1100-
1101-
/// Gets a pointer to the first element of the array.
1102-
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
1103-
#[inline(always)]
1104-
pub const fn slice_as_ptr(this: &[MaybeUninit<T>]) -> *const T {
1105-
this.as_ptr() as *const T
1106-
}
1107-
1108-
/// Gets a mutable pointer to the first element of the array.
1109-
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
1110-
#[inline(always)]
1111-
pub const fn slice_as_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T {
1112-
this.as_mut_ptr() as *mut T
1113-
}
11141100
}
11151101

11161102
impl<T> [MaybeUninit<T>] {
@@ -1477,7 +1463,7 @@ impl<T> [MaybeUninit<T>] {
14771463
/// requirement the compiler knows about it is that the data pointer must be
14781464
/// non-null. Dropping such a `Vec<T>` however will cause undefined
14791465
/// behaviour.
1480-
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
1466+
#[stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
14811467
#[inline(always)]
14821468
#[rustc_const_unstable(feature = "const_drop_in_place", issue = "109342")]
14831469
pub const unsafe fn assume_init_drop(&mut self)
@@ -1499,7 +1485,8 @@ impl<T> [MaybeUninit<T>] {
14991485
/// Calling this when the content is not yet fully initialized causes undefined
15001486
/// behavior: it is up to the caller to guarantee that every `MaybeUninit<T>` in
15011487
/// the slice really is in an initialized state.
1502-
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
1488+
#[stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
1489+
#[rustc_const_stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
15031490
#[inline(always)]
15041491
pub const unsafe fn assume_init_ref(&self) -> &[T] {
15051492
// SAFETY: casting `slice` to a `*const [T]` is safe since the caller guarantees that
@@ -1517,7 +1504,8 @@ impl<T> [MaybeUninit<T>] {
15171504
/// behavior: it is up to the caller to guarantee that every `MaybeUninit<T>` in the
15181505
/// slice really is in an initialized state. For instance, `.assume_init_mut()` cannot
15191506
/// be used to initialize a `MaybeUninit` slice.
1520-
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
1507+
#[stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
1508+
#[rustc_const_stable(feature = "maybe_uninit_slice", since = "CURRENT_RUSTC_VERSION")]
15211509
#[inline(always)]
15221510
pub const unsafe fn assume_init_mut(&mut self) -> &mut [T] {
15231511
// SAFETY: similar to safety notes for `slice_get_ref`, but we have a

0 commit comments

Comments
 (0)