Skip to content

Commit

Permalink
small correction to fmt::Pointer impl
Browse files Browse the repository at this point in the history
the `expose_provenance` method does not require `T: Sized`
  • Loading branch information
Sky9x committed Jun 29, 2024
1 parent 9c3bc80 commit 35f2093
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 35f2093

Please sign in to comment.