-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Some simple improvements to MIR pretty printing #33607
Conversation
In short, this PR changes the MIR printer so that it: * places an empty line between the MIR for each item * does *not* write an empty line before the first BB when there are no var decls * aligns the "// Scope" comments 50 chars in (makes the output more readable) * prints the scope comments as "// scope N at ..." instead of "// Scope(N) at ..." * prints a prettier scope tree: * no more unbalanced delimiters! * no more "Parent" entry (these convey no useful information) * drop the "Scope()" and just print scope IDs * no braces when the scope is empty
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
I'll make the scope tree printing much smaller tomorrow, so hang on until then :) |
🐊 this looks great, thanks for doing this. |
I feel like scope tree would look better like this:
|
40 chars is still enough indentation (most common MIR statements don't take more than 40 chars), and fits more easily in 80-character terminals.
Updated. Also put a |
@bors r+ Thank you! |
📌 Commit 2c7e398 has been approved by |
Some simple improvements to MIR pretty printing In short, this PR changes the MIR printer so that it: * places an empty line between the MIR for each item * does *not* write an empty line before the first BB when there are no var decls * aligns the "// Scope" comments 50 chars in (makes the output more readable) * prints the scope comments as "// scope N at ..." instead of "// Scope(N) at ..." * prints a prettier scope tree: * no more unbalanced delimiters! * no more "Parent" entry (these convey no useful information) * drop the "Scope()" and just print scope IDs * no braces when the scope is empty In action: https://gist.github.com/jonas-schievink/1c11226cbb112892a9470ce0f9870b65
In short, this PR changes the MIR printer so that it:
var decls
readable)
Scope(N) at ..."
In action: https://gist.github.com/jonas-schievink/1c11226cbb112892a9470ce0f9870b65