-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 token::Lit
from ast::Lit
.
#101528
Remove token::Lit
from ast::Lit
.
#101528
Conversation
`token::Lit` contains a `kind` field that indicates what kind of literal it is. `ast::Lit` currently wraps a `token::Lit` but also has its own `kind` field. Which means that `ast::Lit` encodes the literal kind in two different ways. This commit changes `ast::Lit` so it no longer wraps `token::Lit`. It now contains the `symbol` and `suffix` fields from `token::Lit`, but not the `kind` field, eliminating the redundancy. This requires extending `ast::LitKind::ByteStr` to include a `StrStyle` to properly distinguish between cooked and raw byte string literals at the `ast::Lit` level.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
I'm not expecting much performance effect, but let's check anyway: @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit c16f710 with merge 1c91510426b7b23caa649d60e0f31de9e5b09678... |
☀️ Try build successful - checks-actions |
Queued 1c91510426b7b23caa649d60e0f31de9e5b09678 with parent 0568b0a, future comparison URL. |
Finished benchmarking commit (1c91510426b7b23caa649d60e0f31de9e5b09678): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
The @rustbot label: +perf-regression-triaged |
I have moved this into #101562, where it's one of several changes required to shrink |
token::Lit
contains akind
field that indicates what kind of literal it is.ast::Lit
currently wraps atoken::Lit
but also has its ownkind
field. Which means thatast::Lit
encodes the literal kind in two different ways.This commit changes
ast::Lit
so it no longer wrapstoken::Lit
. It now contains thesymbol
andsuffix
fields fromtoken::Lit
, but not thekind
field, eliminating the redundancy. This requires extendingast::LitKind::ByteStr
to include aStrStyle
to properly distinguish between cooked and raw byte string literals at theast::Lit
level.r? @petrochenkov