Rollup merge of #97506 - JohnTitor:stabilize-nonnull-slice-from-raw-parts, r=m-ou-se,the8472
Stabilize `nonnull_slice_from_raw_parts` FCP is done: https://github.com/rust-lang/rust/issues/71941#issuecomment-1100910416 Note that this doesn't const-stabilize `NonNull::slice_from_raw_parts` as `slice_from_raw_parts_mut` isn't const-stabilized yet. Given #67456 and #57349, it's not likely available soon, meanwhile, stabilizing only the feature makes some sense, I think. Closes #71941
This commit is contained in:
commit
102bbbd940
4 changed files with 6 additions and 12 deletions
|
@ -135,7 +135,6 @@
|
|||
#![feature(maybe_uninit_uninit_array)]
|
||||
#![feature(maybe_uninit_uninit_array_transpose)]
|
||||
#![cfg_attr(test, feature(new_uninit))]
|
||||
#![feature(nonnull_slice_from_raw_parts)]
|
||||
#![feature(pattern)]
|
||||
#![feature(pointer_byte_offsets)]
|
||||
#![feature(provide_any)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#![feature(const_cow_is_borrowed)]
|
||||
#![feature(const_heap)]
|
||||
#![feature(const_mut_refs)]
|
||||
#![feature(const_nonnull_slice_from_raw_parts)]
|
||||
#![feature(const_slice_from_raw_parts_mut)]
|
||||
#![feature(const_ptr_write)]
|
||||
#![feature(const_try)]
|
||||
#![feature(core_intrinsics)]
|
||||
|
@ -38,7 +38,6 @@
|
|||
#![feature(const_default_impls)]
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(const_str_from_utf8)]
|
||||
#![feature(nonnull_slice_from_raw_parts)]
|
||||
#![feature(panic_update_hook)]
|
||||
#![feature(pointer_is_aligned)]
|
||||
#![feature(slice_flatten)]
|
||||
|
|
|
@ -462,8 +462,6 @@ impl<T> NonNull<[T]> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(nonnull_slice_from_raw_parts)]
|
||||
///
|
||||
/// use std::ptr::NonNull;
|
||||
///
|
||||
/// // create a slice pointer when starting out with a pointer to the first element
|
||||
|
@ -475,8 +473,8 @@ impl<T> NonNull<[T]> {
|
|||
///
|
||||
/// (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.)
|
||||
#[unstable(feature = "nonnull_slice_from_raw_parts", issue = "71941")]
|
||||
#[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")]
|
||||
#[stable(feature = "nonnull_slice_from_raw_parts", since = "CURRENT_RUSTC_VERSION")]
|
||||
#[rustc_const_unstable(feature = "const_slice_from_raw_parts_mut", issue = "67456")]
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {
|
||||
|
@ -494,7 +492,6 @@ impl<T> NonNull<[T]> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(nonnull_slice_from_raw_parts)]
|
||||
/// use std::ptr::NonNull;
|
||||
///
|
||||
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
||||
|
@ -514,7 +511,7 @@ impl<T> NonNull<[T]> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
|
||||
/// #![feature(slice_ptr_get)]
|
||||
/// use std::ptr::NonNull;
|
||||
///
|
||||
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
||||
|
@ -534,7 +531,7 @@ impl<T> NonNull<[T]> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
|
||||
/// #![feature(slice_ptr_get)]
|
||||
/// use std::ptr::NonNull;
|
||||
///
|
||||
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
||||
|
@ -668,7 +665,7 @@ impl<T> NonNull<[T]> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
|
||||
/// #![feature(slice_ptr_get)]
|
||||
/// use std::ptr::NonNull;
|
||||
///
|
||||
/// let x = &mut [1, 2, 4];
|
||||
|
|
|
@ -292,7 +292,6 @@
|
|||
#![feature(is_some_and)]
|
||||
#![feature(maybe_uninit_slice)]
|
||||
#![feature(maybe_uninit_write_slice)]
|
||||
#![feature(nonnull_slice_from_raw_parts)]
|
||||
#![feature(panic_can_unwind)]
|
||||
#![feature(panic_info_message)]
|
||||
#![feature(panic_internals)]
|
||||
|
|
Loading…
Add table
Reference in a new issue