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 f27723e

Browse files
authoredJun 30, 2024
Rollup merge of rust-lang#127069 - Sky9x:fmt-pointer-use-addr, r=Nilstrieb
small correction to fmt::Pointer impl ~~The `addr` method does not require `T: Sized`, and is preferred for use over `expose_provenance`.~~ `expose_provenance` does not require `T: Sized`.
2 parents b068fce + bf9096f commit f27723e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎core/src/fmt/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2484,8 +2484,7 @@ impl Display for char {
24842484
#[stable(feature = "rust1", since = "1.0.0")]
24852485
impl<T: ?Sized> Pointer for *const T {
24862486
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2487-
// Cast is needed here because `.expose_provenance()` requires `T: Sized`.
2488-
pointer_fmt_inner((*self as *const ()).expose_provenance(), f)
2487+
pointer_fmt_inner(self.expose_provenance(), f)
24892488
}
24902489
}
24912490

0 commit comments

Comments
 (0)
Failed to load comments.