MIR SourceScopes stay around even when all their uses were removed. #68964
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.
We already have a testcase, namely
simplify_try
, which replaces enough of the original body to make someSourceScope
s 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
SourceScope
s only used in unreachable code should still be removed, e.g.:There is no reason to have debuginfo for
x
tracked anywhere once thex = 123;
block is removed.@rust-lang/wg-mir-opt
The text was updated successfully, but these errors were encountered: