diff options
| author | Pointerbender <pointerbender@gmail.com> | 2022-03-05 11:43:19 +0100 |
|---|---|---|
| committer | Pointerbender <pointerbender@gmail.com> | 2022-03-05 13:37:16 +0100 |
| commit | 613f569080c69af36cfb4c83857f2f1472886906 (patch) | |
| tree | e285d9c031d2e6f1b2703b9ca6f6370599057a84 | |
| parent | 86067bb461d044ee30e7880ab6f3b34d5070f1db (diff) | |
| download | rust-613f569080c69af36cfb4c83857f2f1472886906.tar.gz rust-613f569080c69af36cfb4c83857f2f1472886906.zip | |
partially stabilize `(const_)slice_ptr_len` by stabilizing `NonNull::len` #71146
| -rw-r--r-- | library/core/src/ptr/non_null.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs index 0aa8e9960a8..072bae92975 100644 --- a/library/core/src/ptr/non_null.rs +++ b/library/core/src/ptr/non_null.rs @@ -446,14 +446,15 @@ impl<T> NonNull<[T]> { /// # Examples /// /// ```rust - /// #![feature(slice_ptr_len, nonnull_slice_from_raw_parts)] + /// #![feature(nonnull_slice_from_raw_parts)] /// use std::ptr::NonNull; /// /// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3); /// assert_eq!(slice.len(), 3); /// ``` - #[unstable(feature = "slice_ptr_len", issue = "71146")] - #[rustc_const_unstable(feature = "const_slice_ptr_len", issue = "71146")] + #[stable(feature = "slice_ptr_len_nonnull", since = "1.61.0")] + #[rustc_const_stable(feature = "const_slice_ptr_len_nonnull", since = "1.61.0")] + #[rustc_allow_const_fn_unstable(const_slice_ptr_len)] #[must_use] #[inline] pub const fn len(self) -> usize { |
