Skip to content
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

Merged
merged 14 commits into from
Aug 18, 2023
Merged

Conversation

nnethercote
Copy link
Contributor

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

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.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 16, 2023
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2023
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.
@nnethercote nnethercote force-pushed the Nonterminal-cleanups branch from 48ac70a to 9e22351 Compare August 18, 2023 06:50
@nnethercote
Copy link
Contributor Author

I removed the questionable commit.

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Aug 18, 2023

📌 Commit 9e22351 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 18, 2023
@bors
Copy link
Contributor

bors commented Aug 18, 2023

⌛ Testing commit 9e22351 with merge ee5cb9e...

@bors
Copy link
Contributor

bors commented Aug 18, 2023

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing ee5cb9e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 18, 2023
@bors bors merged commit ee5cb9e into rust-lang:master Aug 18, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 18, 2023
@bors bors mentioned this pull request Aug 18, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ee5cb9e): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.3%] 5
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.2% [-4.3%, -4.2%] 2
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) -4.2% [-4.3%, -4.2%] 2

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [3.5%, 3.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 634.323s -> 632.907s (-0.22%)
Artifact size: 347.03 MiB -> 347.12 MiB (0.03%)

@nnethercote nnethercote deleted the Nonterminal-cleanups branch August 20, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants