Skip to content

Commit 613f569

Browse files
committed
partially stabilize (const_)slice_ptr_len by stabilizing NonNull::len #71146
1 parent 86067bb commit 613f569

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/core/src/ptr/non_null.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,15 @@ impl<T> NonNull<[T]> {
446446
/// # Examples
447447
///
448448
/// ```rust
449-
/// #![feature(slice_ptr_len, nonnull_slice_from_raw_parts)]
449+
/// #![feature(nonnull_slice_from_raw_parts)]
450450
/// use std::ptr::NonNull;
451451
///
452452
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
453453
/// assert_eq!(slice.len(), 3);
454454
/// ```
455-
#[unstable(feature = "slice_ptr_len", issue = "71146")]
456-
#[rustc_const_unstable(feature = "const_slice_ptr_len", issue = "71146")]
455+
#[stable(feature = "slice_ptr_len_nonnull", since = "1.61.0")]
456+
#[rustc_const_stable(feature = "const_slice_ptr_len_nonnull", since = "1.61.0")]
457+
#[rustc_allow_const_fn_unstable(const_slice_ptr_len)]
457458
#[must_use]
458459
#[inline]
459460
pub const fn len(self) -> usize {

0 commit comments

Comments
 (0)