constify with_exposed_provenance
This commit is contained in:
parent
eed187cfce
commit
d12ecde365
1 changed files with 4 additions and 2 deletions
|
|
@ -974,9 +974,10 @@ 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")]
|
||||
#[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 fn with_exposed_provenance<T>(addr: usize) -> *const T {
|
||||
pub const fn with_exposed_provenance<T>(addr: usize) -> *const T {
|
||||
addr as *const T
|
||||
}
|
||||
|
||||
|
|
@ -1014,9 +1015,10 @@ pub 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")]
|
||||
#[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 fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T {
|
||||
pub const fn with_exposed_provenance_mut<T>(addr: usize) -> *mut T {
|
||||
addr as *mut T
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue