-
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
Nonterminal
-related cleanups
#114915
Nonterminal
-related cleanups
#114915
Conversation
All nonterminals collect and store tokens now. (Unless they are very simple, e.g. single-token, and can precisely recover them without collecting.)
Adding a `ty_` makes its purpose much clearer, and consistent with other `parse_ty_*` functions.
This test currently tests the successful paths for the `Interpolated`/`NtTy`/`Path` case in `parse_path_inner`, but it doesn't test the failure path.
It makes the code more readable.
For ones matching more than one or two variants, this is easier to think about.
`may_be_ident` is true for `NtPath` and `NtMeta`, so we don't need to check for them separately.
It's much more complicated than it needs to be, and it doesn't modify the expression. We can do the `Result` handling outside of it, and change it to just return a span. Also fix an errant comma that makes the comment hard to read.
By printing the actual value, as long as the expected range. I found this helpful when I encountered one of these errors.
It's more descriptive, and future-proofs it if/when additional variants get added.
48ac70a
to
9e22351
Compare
I removed the questionable commit. @bors r=petrochenkov |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ee5cb9e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 634.323s -> 632.907s (-0.22%) |
In #114647 I am trying to remove
Nonterminal
. It has a number of preliminary cleanups that are worth merging even if #114647 doesn't merge, so let's do them in this PR.r? @petrochenkov