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 6c38c60 commit bf9096f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 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 bf9096f

Please sign in to comment.