mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
constify with_exposed_provenance
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user