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

rustfmt is slow on pest generated grammars #4476

Open
matklad opened this issue Oct 18, 2020 · 2 comments · Fixed by #5139
Open

rustfmt is slow on pest generated grammars #4476

matklad opened this issue Oct 18, 2020 · 2 comments · Fixed by #5139
Labels
bug Panic, non-idempotency, invalid code, etc. generated-code issue related to rustfmt and generated code

Comments

@matklad
Copy link
Member

matklad commented Oct 18, 2020

Rustfmt takes about a minute to reformat 26k file (generated pest grammar).

File in question: https://github.com/steveklabnik/semver-parser/blob/0c43dbb12d35f9b58142b3976391eb52ea71725f/src/generated.rs

To Reproduce

Run this test in the semver-parser repo:

https://github.com/steveklabnik/semver-parser/blob/0c43dbb12d35f9b58142b3976391eb52ea71725f/tests/genpest.rs#L14

Expected behavior

Formatting takes low-digits seconds.

Meta

@Volker-Weissmann
Copy link

This bug seems to have a connection with #4867

@ytmimi
Copy link
Contributor

ytmimi commented Jun 23, 2022

Reopen since we had to revert #5139 in #5403

@ytmimi ytmimi reopened this Jun 23, 2022
@ytmimi ytmimi added the generated-code issue related to rustfmt and generated code label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc. generated-code issue related to rustfmt and generated code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants