Uh oh!
There was an error while loading. Please reload this page.
Add leading 0x to offset in Debug fmt of Pointer - #71459
Conversation
rust-highfive
commented
Apr 23, 2020
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @RalfJung (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
5a3245f to
c16b6e0CompareRalfJung
commented
Apr 23, 2020
oli-obk
commented
Apr 23, 2020
🤷 I don't have a strong opinion. It'll make the relocation size problem in the hex dump worse though, which I think is the main reason I tried to keep it as short as possible |
RalfJung
commented
Apr 23, 2020
I wonder why hex dumps do not show up in the diff here? At least for pointers outside of hex dumps, I think this is a clear improvement. Even within hex dumps, I'd rather shorten |
RalfJung
commented
Apr 23, 2020
For example, How can that be? |
oli-obk
commented
Apr 23, 2020
Likely because the refactoring for the |
RalfJung
commented
Apr 23, 2020
Ah, indeed it does: rust/src/librustc_mir/util/pretty.rs Line 725 in 66f7a5d So should we take advantage of that and leave the dumps without 0x? Seems oddly inconsistent though. (And btw this needs a FIXME to also print the tag.)What about landing this PR to change just |
oli-obk
commented
Apr 23, 2020
Yea, makes sense, let's merge this PR |
RalfJung
commented
Apr 23, 2020
@bors r+ |
bors
commented
Apr 23, 2020
📌 Commit c16b6e0 has been approved by |
…RalfJung Add leading 0x to offset in Debug fmt of Pointer Currently the `Debug` format for `Pointer` prints its offset in hexadecimal, for example, `alloc38657819+e2` or `alloc35122748+64`. This PR adds a leading `0x` to the offset, in order to make it apparent that it is indeed a hexadecimal number. This came up during discussion of rust-lang/miri#1354. r? @RalfJung
Rollup of 6 pull requests Successful merges: - rust-lang#70845 (Make the `structural_match` error diagnostic for const generics clearer) - rust-lang#71063 (Document unsafety in core::{option, hash}) - rust-lang#71068 (Stabilize UNICODE_VERSION (feature unicode_version)) - rust-lang#71426 (fix error code in E0751.md) - rust-lang#71459 (Add leading 0x to offset in Debug fmt of Pointer) - rust-lang#71492 (Document unsafety in core::{panicking, alloc::layout, hint, iter::adapters::zip}) Failed merges: r? @ghost
RalfJung
commented
Apr 26, 2020
Turns out MIR allocation dumping was actually using decimal, while normal |
eddyb
commented
Apr 27, 2020
@RalfJung I'm surprised you didn't notice #71459 (comment) had no I never expected hex offsets, since I had only seen decimal ones thus far. |
Pointer printing was using hex offsets since at least since d01ef7d. |
Currently the
Debugformat forPointerprints its offset in hexadecimal, for example,alloc38657819+e2oralloc35122748+64. This PR adds a leading0xto the offset, in order to make it apparent that it is indeed a hexadecimal number. This came up during discussion of rust-lang/miri#1354. r? @RalfJung