about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSky <sky@sky9.dev>2024-06-27 22:27:59 -0400
committerSky <sky@sky9.dev>2024-06-29 10:33:45 -0400
commit35f209361fcd0751b3d260d67962b0af2d455596 (patch)
tree0e020389ddd23456747008c9e8f8b9cda5dd1ed1
parent9c3bc805dd9cb84019c124b9a50fdff1e62a7ec9 (diff)
downloadrust-35f209361fcd0751b3d260d67962b0af2d455596.tar.gz
rust-35f209361fcd0751b3d260d67962b0af2d455596.zip
small correction to fmt::Pointer impl
the `expose_provenance` method does not require `T: Sized`
-rw-r--r--library/core/src/fmt/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index c25bc5a1b13..69ccc6ce3ca 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<T: ?Sized> 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)
     }
 }