Skip to content

Commit d12ecde

Browse files
committed
constify with_exposed_provenance
1 parent eed187c commit d12ecde

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/core/src/ptr/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,9 +974,10 @@ pub const fn dangling_mut<T>() -> *mut T {
974974
#[must_use]
975975
#[inline(always)]
976976
#[stable(feature = "exposed_provenance", since = "1.84.0")]
977+
#[rustc_const_unstable(feature = "const_exposed_provenance", issue = "144538")]
977978
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
978979
#[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead
979-
pub fn with_exposed_provenance<T>(addr: usize) -> *const T {
980+
pub const fn with_exposed_provenance<T>(addr: usize) -> *const T {
980981
addr as *const T
981982
}
982983

@@ -1014,9 +1015,10 @@ pub fn with_exposed_provenance<T>(addr: usize) -> *const T {
10141015
#[must_use]
10151016
#[inline(always)]
10161017
#[stable(feature = "exposed_provenance", since = "1.84.0")]
1018+
#[rustc_const_unstable(feature = "const_exposed_provenance", issue = "144538")]
10171019
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
10181020
#[allow(fuzzy_provenance_casts)] // this *is* the explicit provenance API one should use instead
1019-
pub fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T {
1021+
pub const fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T {
10201022
addr as *mut T
10211023
}
10221024

0 commit comments

Comments
 (0)