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 SourceScopes stay around even when all their uses were removed. #68964

Open
eddyb opened this issue Feb 8, 2020 · 0 comments
Open

MIR SourceScopes stay around even when all their uses were removed. #68964

eddyb opened this issue Feb 8, 2020 · 0 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-enhancement Category: An issue proposing an enhancement or a PR with one. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@eddyb
Copy link
Member

eddyb commented Feb 8, 2020

We already have a testcase, namely simplify_try, which replaces enough of the original body to make some SourceScopes unused.

However, despite no statements/terminators using those scopes anymore, they stick around.
The fact that they're gone is in itself a problem (debuginfo is lost, see comments on #66282), but we could argue that SourceScopes only used in unreachable code should still be removed, e.g.:

if false {
    let x = 123;
}

There is no reason to have debuginfo for x tracked anywhere once the x = 123; block is removed.

@rust-lang/wg-mir-opt

@jonas-schievink jonas-schievink added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html 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 Feb 8, 2020
@wesleywiser wesleywiser added the P-low Low priority label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html C-enhancement Category: An issue proposing an enhancement or a PR with one. P-low Low priority 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

3 participants