Rollup merge of #127069 - Sky9x:fmt-pointer-use-addr, r=Nilstrieb · model-checking/verify-rust-std@f27723e (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit f27723e

Rollup merge of rust-lang#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`.

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -2484,8 +2484,7 @@ impl Display for char {
2484 2484 #[stable(feature = "rust1", since = "1.0.0")]
2485 2485 impl<T: ?Sized> Pointer for *const T {
2486 2486 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2487 -// Cast is needed here because `.expose_provenance()` requires `T: Sized`.
2488 -pointer_fmt_inner((*self as *const ()).expose_provenance(), f)
2487 +pointer_fmt_inner(self.expose_provenance(), f)
2489 2488 }
2490 2489 }
2491 2490