Skip to content

Commit

Permalink
Rollup merge of rust-lang#127069 - Sky9x:fmt-pointer-use-addr, r=Nils…
Browse files Browse the repository at this point in the history
…trieb

small correction to fmt::Pointer impl

~~The `addr` method does not require `T: Sized`, and is preferred for use over `expose_provenance`.~~
`expose_provenance` does not require `T: Sized`.
  • Loading branch information
matthiaskrgr committed Jun 30, 2024
2 parents e592e5c + 35f2093 commit 5bb4229
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 @@ -2484,8 +2484,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 5bb4229

Please sign in to comment.