Rollup merge of #145462 - Kivooeo:stabilize-const_exposed_provenance, r=RalfJung

Stabilize `const_exposed_provenance` feature

This closes [tracking issue](https://github.com/rust-lang/rust/issues/144538) and stabilises `fn with_exposed_provenance` and `fn with_exposed_provenance_mut` in const
This commit is contained in:
Jacob Pratt 2025-08-15 18:13:32 -04:00 committed by GitHub
commit 2a9bb562ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -974,7 +974,7 @@ pub const fn dangling_mut<T>() -> *mut T {
#[must_use]
#[inline(always)]
#[stable(feature = "exposed_provenance", since = "1.84.0")]
#[rustc_const_unstable(feature = "const_exposed_provenance", issue = "144538")]
#[rustc_const_stable(feature = "const_exposed_provenance", since = "CURRENT_RUSTC_VERSION")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead
pub const fn with_exposed_provenance<T>(addr: usize) -> *const T {
@ -1015,7 +1015,7 @@ pub const fn with_exposed_provenance<T>(addr: usize) -> *const T {
#[must_use]
#[inline(always)]
#[stable(feature = "exposed_provenance", since = "1.84.0")]
#[rustc_const_unstable(feature = "const_exposed_provenance", issue = "144538")]
#[rustc_const_stable(feature = "const_exposed_provenance", since = "CURRENT_RUSTC_VERSION")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead
pub const fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T {