From 35f209361fcd0751b3d260d67962b0af2d455596 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 `expose_provenance` method does not require `T: Sized` --- 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..69ccc6ce3ca3d 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.expose_provenance(), f) } }