-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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] Make scopes debuginfo-specific (visibility scopes). #33989
Conversation
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
Arguably we could avoid rightward drift in the scope/var tree by flattening tails, i.e. the same way two variables, |
@alexcrichton What's happening with Travis? 😞 |
☔ The latest upstream changes (presumably #33583) made this pull request unmergeable. Please resolve the merge conflicts. |
cc me |
@bors r+ |
📌 Commit 0c5930e has been approved by |
[MIR] Make scopes debuginfo-specific (visibility scopes). Fixes #32949 by having MIR (visibility) scopes mimic the lexical structure. Unlike #33235, this PR also removes all scopes without variable bindings. Printing of scopes also changed, e.g. for: ```rust fn foo(x: i32, y: i32) { let a = 0; let b = 0; let c = 0; } ``` Before my changes: ```rust fn foo(arg0: i32, arg1: i32) -> () { let var0: i32; // "x" in scope 1 at <anon>:1:8: 1:9 let var1: i32; // "y" in scope 1 at <anon>:1:16: 1:17 let var2: i32; // "a" in scope 3 at <anon>:1:30: 1:31 let var3: i32; // "b" in scope 6 at <anon>:1:41: 1:42 let var4: i32; // "c" in scope 9 at <anon>:1:52: 1:53 ... scope tree: 0 1 2 3 { 4 5 6 { 7 8 9 10 11 } } } ``` After my changes: ```rust fn foo(arg0: i32, arg1: i32) -> () { scope 1 { let var0: i32; // "x" in scope 1 at <anon>:1:8: 1:9 let var1: i32; // "y" in scope 1 at <anon>:1:16: 1:17 scope 2 { let var2: i32; // "a" in scope 2 at <anon>:1:30: 1:31 scope 3 { let var3: i32; // "b" in scope 3 at <anon>:1:41: 1:42 scope 4 { let var4: i32; // "c" in scope 4 at <anon>:1:52: 1:53 } } } } ... }
Fixes #32949 by having MIR (visibility) scopes mimic the lexical structure.
Unlike #33235, this PR also removes all scopes without variable bindings.
Printing of scopes also changed, e.g. for:
Before my changes:
After my changes: