Skip to content

Commit 2dc9bf0

Browse files
committed
nicer Miri backtraces for from_exposed_addr
1 parent 75b7e52 commit 2dc9bf0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: library/core/src/ptr/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ pub const fn invalid_mut<T>(addr: usize) -> *mut T {
603603
#[must_use]
604604
#[inline]
605605
#[unstable(feature = "strict_provenance", issue = "95228")]
606+
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
606607
pub fn from_exposed_addr<T>(addr: usize) -> *const T
607608
where
608609
T: Sized,
@@ -639,6 +640,7 @@ where
639640
#[must_use]
640641
#[inline]
641642
#[unstable(feature = "strict_provenance", issue = "95228")]
643+
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
642644
pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T
643645
where
644646
T: Sized,

0 commit comments

Comments
 (0)