small correction to fmt::Pointer impl

the `expose_provenance` method does not require `T: Sized`
This commit is contained in:
Sky 2024-06-27 22:27:59 -04:00
parent 9c3bc805dd
commit 35f209361f
No known key found for this signature in database
GPG key ID: EED1A7AF86ACBCEF

View file

@ -2478,8 +2478,7 @@ fn fmt(&self, f: &mut Formatter<'_>) -> Result {
#[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)
}
}