mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Rollup merge of #127069 - Sky9x:fmt-pointer-use-addr, r=Nilstrieb
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`.
This commit is contained in:
commit
7a43417c36
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user