diff options
| author | Ralf Jung <post@ralfj.de> | 2022-07-02 10:53:34 -0400 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-07-02 11:41:16 -0400 |
| commit | c36572c11e0cd179d80b4540890bc046b78a0cb7 (patch) | |
| tree | 012c2a367b48f273cc7e19d8638804c178e296ca /compiler/rustc_middle/src/mir/interpret/pointer.rs | |
| parent | 0075bb4fad68e64b6d1be06bf2db366c30bc75e1 (diff) | |
| download | rust-c36572c11e0cd179d80b4540890bc046b78a0cb7.tar.gz rust-c36572c11e0cd179d80b4540890bc046b78a0cb7.zip | |
add AllocRange Debug impl; remove redundant AllocId Display impl
Diffstat (limited to 'compiler/rustc_middle/src/mir/interpret/pointer.rs')
| -rw-r--r-- | compiler/rustc_middle/src/mir/interpret/pointer.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/mir/interpret/pointer.rs b/compiler/rustc_middle/src/mir/interpret/pointer.rs index 26da93b9dce..81d744107fd 100644 --- a/compiler/rustc_middle/src/mir/interpret/pointer.rs +++ b/compiler/rustc_middle/src/mir/interpret/pointer.rs @@ -144,7 +144,7 @@ impl Provenance for AllocId { } // Print offset only if it is non-zero. if ptr.offset.bytes() > 0 { - write!(f, "+0x{:x}", ptr.offset.bytes())?; + write!(f, "+{:#x}", ptr.offset.bytes())?; } Ok(()) } @@ -181,7 +181,7 @@ impl<Tag: Provenance> fmt::Debug for Pointer<Option<Tag>> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.provenance { Some(tag) => Provenance::fmt(&Pointer::new(tag, self.offset), f), - None => write!(f, "0x{:x}", self.offset.bytes()), + None => write!(f, "{:#x}", self.offset.bytes()), } } } |
