Skip to content

Commit f8bdd9c

Browse files
Rollup merge of #100501 - RalfJung:miri-from-exposed-addr, r=Mark-Simulacrum
nicer Miri backtraces for from_exposed_addr Miri by default warns about using from_exposed_addr; this makes the span for that a bit nicer.
2 parents aafaec3 + 2dc9bf0 commit f8bdd9c

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)