Stabilize nonnull_slice_from_raw_parts
This commit is contained in:
parent
1536a53ea4
commit
22a456ad47
@ -129,7 +129,6 @@
|
|||||||
#![feature(maybe_uninit_slice)]
|
#![feature(maybe_uninit_slice)]
|
||||||
#![feature(maybe_uninit_uninit_array)]
|
#![feature(maybe_uninit_uninit_array)]
|
||||||
#![cfg_attr(test, feature(new_uninit))]
|
#![cfg_attr(test, feature(new_uninit))]
|
||||||
#![feature(nonnull_slice_from_raw_parts)]
|
|
||||||
#![feature(pattern)]
|
#![feature(pattern)]
|
||||||
#![feature(pointer_byte_offsets)]
|
#![feature(pointer_byte_offsets)]
|
||||||
#![feature(provide_any)]
|
#![feature(provide_any)]
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#![feature(const_cow_is_borrowed)]
|
#![feature(const_cow_is_borrowed)]
|
||||||
#![feature(const_heap)]
|
#![feature(const_heap)]
|
||||||
#![feature(const_mut_refs)]
|
#![feature(const_mut_refs)]
|
||||||
#![feature(const_nonnull_slice_from_raw_parts)]
|
#![feature(const_slice_from_raw_parts_mut)]
|
||||||
#![feature(const_ptr_write)]
|
#![feature(const_ptr_write)]
|
||||||
#![feature(const_try)]
|
#![feature(const_try)]
|
||||||
#![feature(core_intrinsics)]
|
#![feature(core_intrinsics)]
|
||||||
@ -36,7 +36,6 @@
|
|||||||
#![feature(const_default_impls)]
|
#![feature(const_default_impls)]
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl)]
|
||||||
#![feature(const_str_from_utf8)]
|
#![feature(const_str_from_utf8)]
|
||||||
#![feature(nonnull_slice_from_raw_parts)]
|
|
||||||
#![feature(panic_update_hook)]
|
#![feature(panic_update_hook)]
|
||||||
#![feature(pointer_is_aligned)]
|
#![feature(pointer_is_aligned)]
|
||||||
#![feature(slice_flatten)]
|
#![feature(slice_flatten)]
|
||||||
|
@ -467,8 +467,6 @@ impl<T> NonNull<[T]> {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(nonnull_slice_from_raw_parts)]
|
|
||||||
///
|
|
||||||
/// use std::ptr::NonNull;
|
/// use std::ptr::NonNull;
|
||||||
///
|
///
|
||||||
/// // create a slice pointer when starting out with a pointer to the first element
|
/// // create a slice pointer when starting out with a pointer to the first element
|
||||||
@ -480,8 +478,8 @@ impl<T> NonNull<[T]> {
|
|||||||
///
|
///
|
||||||
/// (Note that this example artificially demonstrates a use of this method,
|
/// (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.)
|
/// 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")]
|
#[stable(feature = "nonnull_slice_from_raw_parts", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[rustc_const_unstable(feature = "const_nonnull_slice_from_raw_parts", issue = "71941")]
|
#[rustc_const_unstable(feature = "const_slice_from_raw_parts_mut", issue = "67456")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {
|
pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {
|
||||||
@ -499,7 +497,6 @@ pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(nonnull_slice_from_raw_parts)]
|
|
||||||
/// use std::ptr::NonNull;
|
/// use std::ptr::NonNull;
|
||||||
///
|
///
|
||||||
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
||||||
@ -519,7 +516,7 @@ pub const fn len(self) -> usize {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
|
/// #![feature(slice_ptr_get)]
|
||||||
/// use std::ptr::NonNull;
|
/// use std::ptr::NonNull;
|
||||||
///
|
///
|
||||||
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
||||||
@ -539,7 +536,7 @@ pub const fn as_non_null_ptr(self) -> NonNull<T> {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
|
/// #![feature(slice_ptr_get)]
|
||||||
/// use std::ptr::NonNull;
|
/// use std::ptr::NonNull;
|
||||||
///
|
///
|
||||||
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
/// let slice: NonNull<[i8]> = NonNull::slice_from_raw_parts(NonNull::dangling(), 3);
|
||||||
@ -673,7 +670,7 @@ pub const fn as_mut_ptr(self) -> *mut T {
|
|||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(slice_ptr_get, nonnull_slice_from_raw_parts)]
|
/// #![feature(slice_ptr_get)]
|
||||||
/// use std::ptr::NonNull;
|
/// use std::ptr::NonNull;
|
||||||
///
|
///
|
||||||
/// let x = &mut [1, 2, 4];
|
/// let x = &mut [1, 2, 4];
|
||||||
|
@ -294,7 +294,6 @@
|
|||||||
#![feature(is_some_with)]
|
#![feature(is_some_with)]
|
||||||
#![feature(maybe_uninit_slice)]
|
#![feature(maybe_uninit_slice)]
|
||||||
#![feature(maybe_uninit_write_slice)]
|
#![feature(maybe_uninit_write_slice)]
|
||||||
#![feature(nonnull_slice_from_raw_parts)]
|
|
||||||
#![feature(panic_can_unwind)]
|
#![feature(panic_can_unwind)]
|
||||||
#![feature(panic_info_message)]
|
#![feature(panic_info_message)]
|
||||||
#![feature(panic_internals)]
|
#![feature(panic_internals)]
|
||||||
|
Loading…
Reference in New Issue
Block a user