about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-06-09 12:17:55 -0500
committerGitHub <noreply@github.com>2025-06-09 12:17:55 -0500
commitfd06f6d6582bccb4198e13d701ad039258cd8a62 (patch)
tree0a49263d63cd43823190a40302c952ad355dbb41
parentfacc5da22cea0455e11d8385ab34c8a26787e529 (diff)
parent3164ca8bb4ad6af6114926a4160edd95bbb18872 (diff)
downloadrust-fd06f6d6582bccb4198e13d701ad039258cd8a62.tar.gz
rust-fd06f6d6582bccb4198e13d701ad039258cd8a62.zip
Rollup merge of #142238 - RalfJung:nonnull_provenance, r=workingjubilee
stabilize nonnull_provenance

Fixes https://github.com/rust-lang/rust/issues/135243
FCP passed in https://github.com/rust-lang/rust/issues/135243
-rw-r--r--library/alloc/src/lib.rs1
-rw-r--r--library/alloctests/lib.rs1
-rw-r--r--library/core/src/ptr/non_null.rs7
-rw-r--r--library/std/src/lib.rs1
4 files changed, 4 insertions, 6 deletions
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 30540f48aa1..f416732a8d6 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -131,7 +131,6 @@
 #![feature(local_waker)]
 #![feature(maybe_uninit_slice)]
 #![feature(maybe_uninit_uninit_array_transpose)]
-#![feature(nonnull_provenance)]
 #![feature(panic_internals)]
 #![feature(pattern)]
 #![feature(pin_coerce_unsized_trait)]
diff --git a/library/alloctests/lib.rs b/library/alloctests/lib.rs
index 56e60ed4c84..3241b4b0045 100644
--- a/library/alloctests/lib.rs
+++ b/library/alloctests/lib.rs
@@ -28,7 +28,6 @@
 #![feature(iter_next_chunk)]
 #![feature(maybe_uninit_slice)]
 #![feature(maybe_uninit_uninit_array_transpose)]
-#![feature(nonnull_provenance)]
 #![feature(ptr_alignment_type)]
 #![feature(ptr_internals)]
 #![feature(sized_type_properties)]
diff --git a/library/core/src/ptr/non_null.rs b/library/core/src/ptr/non_null.rs
index 91b8d1bf9a7..1fae5b83902 100644
--- a/library/core/src/ptr/non_null.rs
+++ b/library/core/src/ptr/non_null.rs
@@ -89,7 +89,8 @@ impl<T: Sized> NonNull<T> {
     /// For more details, see the equivalent method on a raw pointer, [`ptr::without_provenance_mut`].
     ///
     /// This is a [Strict Provenance][crate::ptr#strict-provenance] API.
-    #[unstable(feature = "nonnull_provenance", issue = "135243")]
+    #[stable(feature = "nonnull_provenance", since = "CURRENT_RUSTC_VERSION")]
+    #[rustc_const_stable(feature = "nonnull_provenance", since = "CURRENT_RUSTC_VERSION")]
     #[must_use]
     #[inline]
     pub const fn without_provenance(addr: NonZero<usize>) -> Self {
@@ -132,7 +133,7 @@ impl<T: Sized> NonNull<T> {
     /// For more details, see the equivalent method on a raw pointer, [`ptr::with_exposed_provenance_mut`].
     ///
     /// This is an [Exposed Provenance][crate::ptr#exposed-provenance] API.
-    #[unstable(feature = "nonnull_provenance", issue = "135243")]
+    #[stable(feature = "nonnull_provenance", since = "CURRENT_RUSTC_VERSION")]
     #[inline]
     pub fn with_exposed_provenance(addr: NonZero<usize>) -> Self {
         // SAFETY: we know `addr` is non-zero.
@@ -329,7 +330,7 @@ impl<T: ?Sized> NonNull<T> {
     /// For more details, see the equivalent method on a raw pointer, [`pointer::expose_provenance`].
     ///
     /// This is an [Exposed Provenance][crate::ptr#exposed-provenance] API.
-    #[unstable(feature = "nonnull_provenance", issue = "135243")]
+    #[stable(feature = "nonnull_provenance", since = "CURRENT_RUSTC_VERSION")]
     pub fn expose_provenance(self) -> NonZero<usize> {
         // SAFETY: The pointer is guaranteed by the type to be non-null,
         // meaning that the address will be non-zero.
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 7c54e731edc..2bb7a63772d 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -351,7 +351,6 @@
 #![feature(lazy_get)]
 #![feature(maybe_uninit_slice)]
 #![feature(maybe_uninit_write_slice)]
-#![feature(nonnull_provenance)]
 #![feature(panic_can_unwind)]
 #![feature(panic_internals)]
 #![feature(pin_coerce_unsized_trait)]