Change:
This is a tracking issue for the method proposed in PR The feature gates for the issue are , and for using as a . Docs: [x] Implementation: [x] FCP: [ ] Stabilization PR
merge
Team member has proposed to merge this. The next step is review by the rest of the tagged team members: [x] [x] [x] [ ] [x] [ ] No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See for info about what commands tagged team members can give me.
I'm willing to file the stabilization report for this if the library team is on board for stabilization.
I'd certainly appreciate one!
:bell: This is now entering its final comment period, as per the . :bell:
The final comment period, with a disposition to merge, as per the , is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon.

Discussion:
#![feature(maybe_uninit_slice)] #![feature(maybe_uninit_uninit_array)] #![cfg_attr(test, feature(new_uninit))] <del> #![feature(nonnull_slice_from_raw_parts)] </del> #![feature(pattern)] #![feature(pointer_byte_offsets)] #![feature(provide_any)]

#![feature(const_cow_is_borrowed)] #![feature(const_heap)] #![feature(const_mut_refs)] <del> #![feature(const_nonnull_slice_from_raw_parts)] </del> <ins> #![feature(const_slice_from_raw_parts_mut)] </ins> #![feature(const_ptr_write)] #![feature(const_try)] #![feature(core_intrinsics)]

#![feature(const_default_impls)] #![feature(const_trait_impl)] #![feature(const_str_from_utf8)] <del> #![feature(nonnull_slice_from_raw_parts)] </del> #![feature(panic_update_hook)] #![feature(pointer_is_aligned)] #![feature(slice_flatten)]

/// # Examples /// /// ```rust <del> /// #![feature(nonnull_slice_from_raw_parts)] /// </del> /// use std::ptr::NonNull; /// /// // create a slice pointer when starting out with a pointer to the first element

/// /// (Note that this example artificially demonstrates a use of this method, /// but `let slice = NonNull::from(&x[..]);` would be a better way to write code like this.) <del> #[unstable(feature = "nonnull_slice_from_raw_parts", issue = "71941")] #[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")] </del> <ins> #[stable(feature = "nonnull_slice_from_raw_parts", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_slice_from_raw_parts_mut", issue = "67456")] </ins> #[must_use] #[inline] pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {

/// # Examples /// /// ```rust <del> /// #![feature(nonnull_slice_from_raw_parts)] </del> /// use std::ptr::NonNull; /// /// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);

/// # Examples /// /// ```rust <del> /// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)] </del> <ins> /// #![feature(slice_ptr_get)] </ins> /// use std::ptr::NonNull; /// /// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);

/// # Examples /// /// ``` <del> /// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)] </del> <ins> /// #![feature(slice_ptr_get)] </ins> /// use std::ptr::NonNull; /// /// let x = &mut [1, 2, 4];

#![feature(is_some_with)] #![feature(maybe_uninit_slice)] #![feature(maybe_uninit_write_slice)] <del> #![feature(nonnull_slice_from_raw_parts)] </del> #![feature(panic_can_unwind)] #![feature(panic_info_message)] #![feature(panic_internals)]