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

Parser simplifications #100559

Merged
merged 2 commits into from
Aug 15, 2022
Merged

Conversation

nnethercote
Copy link
Contributor

Best reviewed one commit at a time.

r? @compiler-errors

Let-chaining avoids some code duplication.
`Parser::parse_bottom_expr` currently constructs an empty `attrs` and
then passes it to a large number of other functions. This makes the code
harder to read than it should be, because it's not clear that many
`attrs` arguments are always empty.

This commit removes `attrs` and the passing, simplifying a lot of
functions. The commit also renames `Parser::mk_expr` (which takes an
`attrs` argument) as `mk_expr_with_attrs`, and introduces a new
`mk_expr` which creates an expression with no attributes, which is the
more common case.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 15, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 15, 2022
@nnethercote
Copy link
Contributor Author

I'm not expecting much of an effect on performance, but just in case:

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 15, 2022
@bors
Copy link
Contributor

bors commented Aug 15, 2022

⌛ Trying commit 2ef0479 with merge 53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5...

@bors
Copy link
Contributor

bors commented Aug 15, 2022

☀️ Try build successful - checks-actions
Build commit: 53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5 (53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5)

@rust-timer
Copy link
Collaborator

Queued 53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5 with parent 76c427d, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: ✅ relevant improvements found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-4.2% -7.4% 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.2% -7.4% 3

Cycles

Results
  • Primary benchmarks: ❌ relevant regressions found
  • Secondary benchmarks: ❌ relevant regression found
mean1 max count2
Regressions ❌
(primary)
2.6% 3.9% 4
Regressions ❌
(secondary)
2.0% 2.0% 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% 3.9% 4

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 15, 2022
@nnethercote
Copy link
Contributor Author

Performance was neutral.

@bors rollup=always

@compiler-errors
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 15, 2022

📌 Commit 2ef0479 has been approved by compiler-errors

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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 15, 2022
…, r=compiler-errors

Parser simplifications

Best reviewed one commit at a time.

r? `@compiler-errors`
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2022
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#100031 (improve "try ignoring the field" diagnostic)
 - rust-lang#100325 (Rustdoc-Json: Don't remove impls for items imported from private modules)
 - rust-lang#100377 (Replace - with _ in fluent slugs to improve developer workflows)
 - rust-lang#100458 (Adjust span of fn argument declaration)
 - rust-lang#100514 (Delay span bug when failing to normalize negative coherence impl subject due to other malformed impls)
 - rust-lang#100528 (Support 1st group of RISC-V Bitmanip backend target features)
 - rust-lang#100559 (Parser simplifications)
 - rust-lang#100568 (Fix STD build for ESP-IDF)
 - rust-lang#100582 ([rustdoc] Fix handling of stripped enum variant in JSON output format)
 - rust-lang#100586 (Reland changes replacing num_cpus with available_parallelism )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e14d12c into rust-lang:master Aug 15, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 15, 2022
@nnethercote nnethercote deleted the parser-simplifications branch August 15, 2022 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants