-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
} | ||
|
||
// 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 |
There was a problem hiding this comment.
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.
38a77ab
to
6d8ae3d
Compare
6d8ae3d
to
ed14202
Compare
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 |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ed14202 with merge 33d75753ae83e2feff234d7e8e9dfb60bbaefad5... |
☀️ Try build successful - checks-actions |
Queued 33d75753ae83e2feff234d7e8e9dfb60bbaefad5 with parent 43dd3d5, future comparison URL. |
cc @estebank |
Co-authored-by: Esteban Kuber <[email protected]>
Finished benchmarking commit (33d75753ae83e2feff234d7e8e9dfb60bbaefad5): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking 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 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.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
@bors r+ |
@bors rollup- |
…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
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