From b1d6dad2ac9bce589dde8a4f89a62320ecce53a0 Mon Sep 17 00:00:00 2001 From: Sky Date: Thu, 27 Jun 2024 22:27:59 -0400 Subject: [PATCH] small correction to fmt::Pointer impl the `addr` method does not require `T: Sized`, and is preferred for use over `expose_provenance` --- library/core/src/fmt/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index c25bc5a1b13c9..e76b812ce2d97 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -2478,8 +2478,7 @@ impl Display for char { #[stable(feature = "rust1", since = "1.0.0")] impl Pointer for *const T { fn fmt(&self, f: &mut Formatter<'_>) -> Result { - // Cast is needed here because `.expose_provenance()` requires `T: Sized`. - pointer_fmt_inner((*self as *const ()).expose_provenance(), f) + pointer_fmt_inner(self.addr(), f) } }