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

Add flag to forbid recovery in the parser #103544

Merged
merged 3 commits into from
Oct 28, 2022

Conversation

Noratrieb
Copy link
Member

To start the effort of fixing #103534, this adds a new flag to the parser, which forbids the parser from doing recovery, which it shouldn't do in macros.

This doesn't add any new checks for recoveries yet and is just here to bikeshed the names for the functions here before doing more.

r? @compiler-errors

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 25, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 25, 2022
}

// This type is used a lot, e.g. it's cloned when matching many declarative macro rules. Make sure
// This type is used a lot, e.g. it's cloned when matching many declarative macro rules with nonterminals. Make sure
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was a little unprecise, as macro matching now uses a Cow<'_, Parser> which it only clones when it actually needs nonterminals. Since the hottest macros (html5ever) don't use nonterminals, the parser size becomes less important.

@compiler-errors
Copy link
Member

Let's do a perf run just to check that the parser size increase has no side-effects, otherwise we should probably just (mis/re)use the subparser name field as the "should recover" field.

@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 Oct 26, 2022
@bors
Copy link
Contributor

bors commented Oct 26, 2022

⌛ Trying commit ed14202 with merge 33d75753ae83e2feff234d7e8e9dfb60bbaefad5...

@bors
Copy link
Contributor

bors commented Oct 26, 2022

☀️ Try build successful - checks-actions
Build commit: 33d75753ae83e2feff234d7e8e9dfb60bbaefad5 (33d75753ae83e2feff234d7e8e9dfb60bbaefad5)

@rust-timer
Copy link
Collaborator

Queued 33d75753ae83e2feff234d7e8e9dfb60bbaefad5 with parent 43dd3d5, future comparison URL.

@Noratrieb
Copy link
Member Author

cc @estebank

Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (33d75753ae83e2feff234d7e8e9dfb60bbaefad5): comparison URL.

Overall result: ✅ improvements - no action needed

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

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
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.

mean1 range count2
Regressions ❌
(primary)
1.2% [1.2%, 1.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [1.2%, 1.2%] 1

Cycles

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

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 Oct 26, 2022
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 26, 2022

📌 Commit da407ed 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 Oct 26, 2022
@compiler-errors
Copy link
Member

@bors rollup-

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 27, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#103110 (remove redundant Send impl for references)
 - rust-lang#103255 (Clean up hidden type registration)
 - rust-lang#103394 (Clarify documentation about the memory layout of `UnsafeCell`)
 - rust-lang#103408 (Clean return-position `impl Trait` in traits correctly in rustdoc)
 - rust-lang#103505 (rustdoc: parse self-closing tags and attributes in `invalid_html_tags`)
 - rust-lang#103524 (rustc_metadata: Add struct and variant constructors to module children at encoding time)
 - rust-lang#103544 (Add flag to forbid recovery in the parser)
 - rust-lang#103616 (rustdoc: remove CSS workaround for Firefox 29)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f9dfb6e into rust-lang:master Oct 28, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 28, 2022
@Noratrieb Noratrieb deleted the no-recovery-pls branch October 28, 2022 05:25
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.

7 participants