Stabilize #![feature(non_null_from_ref)]

This commit is contained in:
Mathis B
2025-04-30 14:42:15 +02:00
committed by Mathis Bottinelli
parent 7188f45311
commit e83a0a4bbe
2 changed files with 4 additions and 3 deletions

View File

@@ -111,7 +111,6 @@
#![feature(is_ascii_octdigit)]
#![feature(lazy_get)]
#![feature(link_cfg)]
#![feature(non_null_from_ref)]
#![feature(offset_of_enum)]
#![feature(panic_internals)]
#![feature(ptr_alignment_type)]

View File

@@ -262,7 +262,8 @@ impl<T: ?Sized> NonNull<T> {
}
/// Converts a reference to a `NonNull` pointer.
#[unstable(feature = "non_null_from_ref", issue = "130823")]
#[stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
#[inline]
pub const fn from_ref(r: &T) -> Self {
// SAFETY: A reference cannot be null.
@@ -270,7 +271,8 @@ impl<T: ?Sized> NonNull<T> {
}
/// Converts a mutable reference to a `NonNull` pointer.
#[unstable(feature = "non_null_from_ref", issue = "130823")]
#[stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "non_null_from_ref", since = "CURRENT_RUSTC_VERSION")]
#[inline]
pub const fn from_mut(r: &mut T) -> Self {
// SAFETY: A mutable reference cannot be null.