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 refuses to format a file #6223

Closed
Speak2Erase opened this issue Jun 30, 2024 · 1 comment
Closed

rustfmt refuses to format a file #6223

Speak2Erase opened this issue Jun 30, 2024 · 1 comment

Comments

@Speak2Erase
Copy link

rustfmt refuses to format https://github.com/Astrabit-ST/Luminol/blob/ceea9bf0d99a12c1d1d3479c1ec80320d54fcc32/crates/modals/src/event_graphic_picker.rs. Whenever I make a change that leaves behind a trailing whitespace, it doesn't get formatted away.
Instead, I see this in my terminal: (running cargo fmt)
image
It drives me crazy whenever this happens, because it'll happen randomly to one of the files in my project, and then suddenly fix itself a few weeks later
I tried rustfmt 1.7.1-nightly (e9e6e2e 2024-06-28 and this still seems to be an issue.

@ytmimi
Copy link
Contributor

ytmimi commented Jul 1, 2024

i think this is a duplicate of #3863 that results in a whitespace error message. When rustfmt fails to format any AST node it leaves the span of that node unformatted. If the span contains trailing whitespace then rustfmt will leave that unchanged as well, and later issue the error message to alert the user that there's whitespace it can't remove.

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants