Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIR dump const Allocation printing of large relocation ids #70339

Open
oli-obk opened this issue Mar 23, 2020 · 3 comments
Open

MIR dump const Allocation printing of large relocation ids #70339

oli-obk opened this issue Mar 23, 2020 · 3 comments
Labels
A-const-eval Area: constant evaluation (mir interpretation) A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Mar 23, 2020

After #69916 the MIR dump of const Allocations can result in things like

    0x80 │ 00 00 00 00 00 00 00 00 00 00 ╾alloc11+0╼ 00 00
    0x90 │ ╾alloc12+99 (4 ptr bytes)╼ 00 00 00 00 00 00 00 00 00 00 00 00

where even just the alloc12+99 would be too wide on 32 bit systems.

We should find better ways to handle this. Some suggestions:

1. Indent all columns so they align again after the oversized relocation

    0x80 │ 00 00 00 00                00 00 00 00 00 00 ╾alloc11+0╼ 00 00
    0x90 │ ╾alloc12+99 (4 ptr bytes)╼ 00 00 00 00 00 00 00 00 00 00 00 00

2. More ascii art

    0x80 │ 00 00 00 00 00 00 00 00 00 00 ╾alloc11+0╼ 00 00
    0x90 │ ╾─────┬───╼ 00 00 00 00 00 00 00 00 00 00 00 00
          ┌──────┴─────┐
          │ alloc12+99 │
          └────────────┘
@jonas-schievink jonas-schievink added A-const-eval Area: constant evaluation (mir interpretation) A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 23, 2020
@jclarkson
Copy link

Hi, I would like to have a go at this.

@jclarkson
Copy link

@rustbot claim

@dtolnay
Copy link
Member

dtolnay commented Jan 27, 2022

@rustbot release-assignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: constant evaluation (mir interpretation) A-mir Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants