Uh oh!
There was an error while loading. Please reload this page.
Some simple improvements to MIR pretty printing - #33607
Merged
Merged
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
rust-highfive
commented
May 12, 2016
Contributor
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
jonas-schievink
commented
May 12, 2016
ContributorAuthor
I'll make the scope tree printing much smaller tomorrow, so hang on until then :) |
nikomatsakis
commented
May 12, 2016
Contributor
🐊 this looks great, thanks for doing this. |
nagisa
commented
May 12, 2016
Member
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.
jonas-schievink
commented
May 13, 2016
ContributorAuthor
Updated. Also put a |
eddyb
commented
May 14, 2016
Contributor
@bors r+ Thank you! |
bors
commented
May 14, 2016
Collaborator
📌 Commit 2c7e398 has been approved by |
bors
commented
May 15, 2016
Collaborator
bors added a commit
that referenced
this pull request
May 15, 2016
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
bors
commented
May 15, 2016
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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