-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Parser simplifications #100559
Conversation
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.
I'm not expecting much of an effect on performance, but just in case: @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2ef0479 with merge 53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5... |
☀️ Try build successful - checks-actions |
Queued 53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5 with parent 76c427d, future comparison URL. |
Finished benchmarking commit (53e1858d7de4e28a9bb7bf4de473f3f9f8e7b3b5): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
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 Footnotes |
Performance was neutral. @bors rollup=always |
Thanks! @bors r+ |
…, r=compiler-errors Parser simplifications Best reviewed one commit at a time. r? `@compiler-errors`
…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
Best reviewed one commit at a time.
r? @compiler-errors