-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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 more cleanups to syntax::print #62532
Commits on Jul 10, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 9b0ebfa - Browse repository at this point
Copy the full SHA 9b0ebfaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f10d11 - Browse repository at this point
Copy the full SHA 0f10d11View commit details -
Configuration menu - View commit details
-
Copy full SHA for a440337 - Browse repository at this point
Copy the full SHA a440337View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11d5216 - Browse repository at this point
Copy the full SHA 11d5216View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae5ed9b - Browse repository at this point
Copy the full SHA ae5ed9bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4483980 - Browse repository at this point
Copy the full SHA 4483980View commit details -
Configuration menu - View commit details
-
Copy full SHA for a573d14 - Browse repository at this point
Copy the full SHA a573d14View commit details -
We always check against the length before indexing anyway.
Configuration menu - View commit details
-
Copy full SHA for 59b161c - Browse repository at this point
Copy the full SHA 59b161cView commit details -
There was only one callsite for each and this removes the unwrap_or_default's on the comments argument
Configuration menu - View commit details
-
Copy full SHA for 9b5e397 - Browse repository at this point
Copy the full SHA 9b5e397View commit details -
Combine comment-handling logic into struct
This also permits sharing the underlying code between pprust and hir::print.
Configuration menu - View commit details
-
Copy full SHA for 0eb2e56 - Browse repository at this point
Copy the full SHA 0eb2e56View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e37914 - Browse repository at this point
Copy the full SHA 7e37914View commit details -
Configuration menu - View commit details
-
Copy full SHA for e0db2e6 - Browse repository at this point
Copy the full SHA e0db2e6View commit details -
Inline State::new_from_input in pprust
This function took too many arguments and are simple on the inside; inlining them makes complexity go down. hir::print's copy is unfortunately used from librustc_driver so inlining it is not as straightforward.
Configuration menu - View commit details
-
Copy full SHA for e0ffa7c - Browse repository at this point
Copy the full SHA e0ffa7cView commit details -
Move pp::Printer out field to owned String
This enforces that eof() must be called to get the String out, and generally is better from an API perspective. No users of pretty printing pre-allocate the buffer.
Configuration menu - View commit details
-
Copy full SHA for 00ca508 - Browse repository at this point
Copy the full SHA 00ca508View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4c58fc3 - Browse repository at this point
Copy the full SHA 4c58fc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ccf279d - Browse repository at this point
Copy the full SHA ccf279dView commit details -
Configuration menu - View commit details
-
Copy full SHA for cd2d832 - Browse repository at this point
Copy the full SHA cd2d832View commit details -
Configuration menu - View commit details
-
Copy full SHA for 55a6a76 - Browse repository at this point
Copy the full SHA 55a6a76View commit details -
Presumably the code was from an older age of Rust and can now be written much simpler.
Configuration menu - View commit details
-
Copy full SHA for 57cf7a2 - Browse repository at this point
Copy the full SHA 57cf7a2View commit details -
Remove is_begin/is_end functions from PrintState
These are somewhat ambiguous (beginning/end of what?) so it's better to inline their one use into the code.
Configuration menu - View commit details
-
Copy full SHA for 4783d9e - Browse repository at this point
Copy the full SHA 4783d9eView commit details -
Rename pretty_print_* to scan_* to follow naming in the paper
This is also easier to understand because the scan and print "tasks" are separate, but previously were both called "print" or "pretty print."
Configuration menu - View commit details
-
Copy full SHA for 5879146 - Browse repository at this point
Copy the full SHA 5879146View commit details -
Drop length from Token::String
It was always set to the string's length
Configuration menu - View commit details
-
Copy full SHA for 04b80a5 - Browse repository at this point
Copy the full SHA 04b80a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39aa9bf - Browse repository at this point
Copy the full SHA 39aa9bfView commit details -
Rename is_bol -> is_beginning_of_line
Also moves it to pp::Printer from PrintState.
Configuration menu - View commit details
-
Copy full SHA for e91dbc5 - Browse repository at this point
Copy the full SHA e91dbc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for cab4532 - Browse repository at this point
Copy the full SHA cab4532View commit details -
Configuration menu - View commit details
-
Copy full SHA for daf1b29 - Browse repository at this point
Copy the full SHA daf1b29View commit details -
Remove needless indent arguments
We're always indenting by INDENT_UNIT anyway
Configuration menu - View commit details
-
Copy full SHA for 63fdf1a - Browse repository at this point
Copy the full SHA 63fdf1aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 73c1752 - Browse repository at this point
Copy the full SHA 73c1752View commit details -
Configuration menu - View commit details
-
Copy full SHA for 096cb41 - Browse repository at this point
Copy the full SHA 096cb41View commit details -
Configuration menu - View commit details
-
Copy full SHA for 56a9237 - Browse repository at this point
Copy the full SHA 56a9237View commit details