about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathis B <mathis.bottinelli@student-cs.fr>2025-04-30 14:42:15 +0200
committerMathis Bottinelli <mathis.bottinelli@student-cs.fr>2025-04-30 17:54:07 +0200
commite83a0a4bbe9cb89bb24f76b4422a3a9a23e45dc5 (patch)
tree01d0f83cfe7dd2f2cb583a1bcf384aa44639f0d3
parent7188f453111502962326022740e2657fce0a6939 (diff)
downloadrust-e83a0a4bbe9cb89bb24f76b4422a3a9a23e45dc5.tar.gz
rust-e83a0a4bbe9cb89bb24f76b4422a3a9a23e45dc5.zip
Stabilize `#![feature(non_null_from_ref)]`
-rw-r--r--library/core/src/lib.rs1
-rw-r--r--library/core/src/ptr/non_null.rs6
2 files changed, 4 insertions, 3 deletions
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 64a7ec8906b..4e8d1dc1152 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -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)]
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index 0864cc457b6..be23dc53880 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -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.