Skip to content

Commit f74bcfb

Browse files
authored
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`
2 parents 224fa39 + f2d0366 commit f74bcfb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/fmt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,8 +2471,8 @@ impl Display for char {
24712471
#[stable(feature = "rust1", since = "1.0.0")]
24722472
impl<T: ?Sized> Pointer for *const T {
24732473
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2474-
// Cast is needed here because `.addr()` requires `T: Sized`.
2475-
pointer_fmt_inner((*self as *const ()).addr(), f)
2474+
// Cast is needed here because `.expose_addr()` requires `T: Sized`.
2475+
pointer_fmt_inner((*self as *const ()).expose_addr(), f)
24762476
}
24772477
}
24782478

0 commit comments

Comments
 (0)