Skip to content

Fail when recoverable parser errors occurs in ignored files with rustfmt-recursive #4592

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

Closed
sasurau4 opened this issue Dec 15, 2020 · 2 comments · Fixed by #4596
Closed

Fail when recoverable parser errors occurs in ignored files with rustfmt-recursive #4592

sasurau4 opened this issue Dec 15, 2020 · 2 comments · Fixed by #4596
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@sasurau4
Copy link
Contributor

sasurau4 commented Dec 15, 2020

Describe the bug

Fail when formatting recoverable parser errors occurs in ignored files with rustfmt-recursive.
I found it working #4113 with issue-3779/ice.rs

To Reproduce

  1. Add // rustfmt-recursive: true to the head of tests/source/issue-3779/lib.rs
  2. run cargo make test
  3. Fail with following error
error: invalid suffix `x` for integer literal
 --> tests/source/issue-3779/ice.rs:2:5
  |
2 |     1x;
  |     ^^ invalid suffix `x`
  |
  = help: the suffix must be one of the integral types (`u32`, `isize`, etc)

Expected behavior

cargo make test passes

Meta

  • rustfmt version: current master 81ad114
@sasurau4 sasurau4 added the bug Panic, non-idempotency, invalid code, etc. label Dec 15, 2020
@sasurau4 sasurau4 changed the title Fail when formatting multiple files that occurs recoverable parser errors with rustfmt-recursive Fail recoverable parser errors occurs in ignored files with rustfmt-recursive Dec 15, 2020
@sasurau4 sasurau4 changed the title Fail recoverable parser errors occurs in ignored files with rustfmt-recursive Fail when recoverable parser errors occurs in ignored files with rustfmt-recursive Dec 15, 2020
@calebcartwright
Copy link
Member

Haven't had time to look at this closely but based on a quick glance my sense is that this is actually failing because the config/ignore settings aren't actually getting picked up, so rustfmt is attempting to parse the ice mod?

@sasurau4
Copy link
Contributor Author

@calebcartwright Yes, you are right. rustfmt is attempting to parse the ice mod. It will be fixed by #4596

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants