Skip to content

Commit

Permalink
Rollup merge of #100501 - RalfJung:miri-from-exposed-addr, r=Mark-Sim…
Browse files Browse the repository at this point in the history
…ulacrum

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.
  • Loading branch information
compiler-errors authored Aug 13, 2022
2 parents aafaec3 + 2dc9bf0 commit f8bdd9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ pub const fn invalid_mut<T>(addr: usize) -> *mut T {
#[must_use]
#[inline]
#[unstable(feature = "strict_provenance", issue = "95228")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn from_exposed_addr<T>(addr: usize) -> *const T
where
T: Sized,
Expand Down Expand Up @@ -639,6 +640,7 @@ where
#[must_use]
#[inline]
#[unstable(feature = "strict_provenance", issue = "95228")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T
where
T: Sized,
Expand Down

0 comments on commit f8bdd9c

Please sign in to comment.