-
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
Remove some unncessary spaces from pretty-printed tokenstream output #84920
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try |
⌛ Trying commit 28ea465de8d66b5beffb6ada79005cfa8699d441 with merge 6f8a6450478f69b8510c8976ab6c2a70b3b0e47c... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
All of the regressions look spurious |
In addition to making the output look nicer for all crates, this also aligns the pretty-printing output with what the `rental` crate expects. This will allow us to eventually disable a backwards-compat hack in a follow-up PR.
28ea465
to
357c013
Compare
The plan was to preserve spacing ("jointness") information for all tokens and print spaces accordingly to it, but the first step (#76285) was unfortunately reverted due to regressions and it didn't go anywhere since then. |
@bors r+ |
📌 Commit 357c013 has been approved by |
@petrochenkov The current proc-macro API only exposes jointness for punctuation, meaning that any extra information we store will be lost after a deep recollection. So, I think we'd still want this PR even if we start trying to preserve more jointness information. |
Just in case this cases some non-spurious regressions: |
☀️ Test successful - checks-actions |
In addition to making the output look nicer for all crates, this also
aligns the pretty-printing output with what the
rental
crate expects.This will allow us to eventually disable a backwards-compat hack in a
follow-up PR.
See #84428 for some background information about why we want to make this change. Note that this change would be desirable (but not particularly necessary) even if
rental
didn't exist, so we're not adding any crate-specific hacks into the compiler.