Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b1d6dad

Browse files
authoredJun 28, 2024··
small correction to fmt::Pointer impl
the `addr` method does not require `T: Sized`, and is preferred for use over `expose_provenance`
1 parent 9c3bc80 commit b1d6dad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎library/core/src/fmt/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2478,8 +2478,7 @@ impl Display for char {
24782478
#[stable(feature = "rust1", since = "1.0.0")]
24792479
impl<T: ?Sized> Pointer for *const T {
24802480
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2481-
// Cast is needed here because `.expose_provenance()` requires `T: Sized`.
2482-
pointer_fmt_inner((*self as *const ()).expose_provenance(), f)
2481+
pointer_fmt_inner(self.addr(), f)
24832482
}
24842483
}
24852484

0 commit comments

Comments
 (0)
Please sign in to comment.