mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rollup merge of #105682 - thomcc:expose-ptr-fmt, r=RalfJung
Use `expose_addr()` in `fmt::Pointer` Discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-lang.2Fwg-unsafe-code-guidelines/topic/Should.20.60fmt.3A.3APointer.60.20expose.20the.20argument.3F on whether or not we should do this (still undecided). CC `@RalfJung`
This commit is contained in:
commit
f74bcfbdb1
@ -2471,8 +2471,8 @@ 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 `.addr()` requires `T: Sized`.
|
||||
pointer_fmt_inner((*self as *const ()).addr(), f)
|
||||
// Cast is needed here because `.expose_addr()` requires `T: Sized`.
|
||||
pointer_fmt_inner((*self as *const ()).expose_addr(), f)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user