Skip to content

stabilize nonnull_provenance #142238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
1 change: 0 additions & 1 deletion library/alloctests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
7 changes: 4 additions & 3 deletions library/core/src/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Loading