Skip to content

Commit 22a456a

Browse files
committed
Stabilize nonnull_slice_from_raw_parts
1 parent 1536a53 commit 22a456a

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
#![feature(maybe_uninit_slice)]
130130
#![feature(maybe_uninit_uninit_array)]
131131
#![cfg_attr(test, feature(new_uninit))]
132-
#![feature(nonnull_slice_from_raw_parts)]
133132
#![feature(pattern)]
134133
#![feature(pointer_byte_offsets)]
135134
#![feature(provide_any)]

library/alloc/tests/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![feature(const_cow_is_borrowed)]
99
#![feature(const_heap)]
1010
#![feature(const_mut_refs)]
11-
#![feature(const_nonnull_slice_from_raw_parts)]
11+
#![feature(const_slice_from_raw_parts_mut)]
1212
#![feature(const_ptr_write)]
1313
#![feature(const_try)]
1414
#![feature(core_intrinsics)]
@@ -36,7 +36,6 @@
3636
#![feature(const_default_impls)]
3737
#![feature(const_trait_impl)]
3838
#![feature(const_str_from_utf8)]
39-
#![feature(nonnull_slice_from_raw_parts)]
4039
#![feature(panic_update_hook)]
4140
#![feature(pointer_is_aligned)]
4241
#![feature(slice_flatten)]

library/core/src/ptr/non_null.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,6 @@ impl<T> NonNull<[T]> {
467467
/// # Examples
468468
///
469469
/// ```rust
470-
/// #![feature(nonnull_slice_from_raw_parts)]
471-
///
472470
/// use std::ptr::NonNull;
473471
///
474472
/// // create a slice pointer when starting out with a pointer to the first element
@@ -480,8 +478,8 @@ impl<T> NonNull<[T]> {
480478
///
481479
/// (Note that this example artificially demonstrates a use of this method,
482480
/// but `let slice = NonNull::from(&x[..]);` would be a better way to write code like this.)
483-
#[unstable(feature = "nonnull_slice_from_raw_parts", issue = "71941")]
484-
#[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")]
481+
#[stable(feature = "nonnull_slice_from_raw_parts", since = "CURRENT_RUSTC_VERSION")]
482+
#[rustc_const_unstable(feature = "const_slice_from_raw_parts_mut", issue = "67456")]
485483
#[must_use]
486484
#[inline]
487485
pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {
@@ -499,7 +497,6 @@ impl<T> NonNull<[T]> {
499497
/// # Examples
500498
///
501499
/// ```rust
502-
/// #![feature(nonnull_slice_from_raw_parts)]
503500
/// use std::ptr::NonNull;
504501
///
505502
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
@@ -519,7 +516,7 @@ impl<T> NonNull<[T]> {
519516
/// # Examples
520517
///
521518
/// ```rust
522-
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
519+
/// #![feature(slice_ptr_get)]
523520
/// use std::ptr::NonNull;
524521
///
525522
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
@@ -539,7 +536,7 @@ impl<T> NonNull<[T]> {
539536
/// # Examples
540537
///
541538
/// ```rust
542-
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
539+
/// #![feature(slice_ptr_get)]
543540
/// use std::ptr::NonNull;
544541
///
545542
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
@@ -673,7 +670,7 @@ impl<T> NonNull<[T]> {
673670
/// # Examples
674671
///
675672
/// ```
676-
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
673+
/// #![feature(slice_ptr_get)]
677674
/// use std::ptr::NonNull;
678675
///
679676
/// let x = &mut [1, 2, 4];

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@
294294
#![feature(is_some_with)]
295295
#![feature(maybe_uninit_slice)]
296296
#![feature(maybe_uninit_write_slice)]
297-
#![feature(nonnull_slice_from_raw_parts)]
298297
#![feature(panic_can_unwind)]
299298
#![feature(panic_info_message)]
300299
#![feature(panic_internals)]

0 commit comments

Comments
 (0)