-
Notifications
You must be signed in to change notification settings - Fork 899
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
"left behind trailing whitespace" in long patterns #5559
Comments
Thanks for the report!. I believe your assessment is correct and we're trying to put the pattern and the type on the same line. After looking into it I think what's happening is there's enough space to write the pattern on a single line so we format it on one line, but there isn't enough space to put both the pattern and the type on one line so rewriting fails, which leads to returning the span unchanged. I did some digging to try and pin that down: starting at Lines 2287 to 2296 in ef91154
Lines 2595 to 2597 in ef91154
For anyone interested in taking this on I'd start looking at the Lines 2035 to 2088 in ef91154
I'd assume we'll also need to make some changes to Lines 258 to 260 in ef91154
|
Code like this:
triggers "left behind trailing whitespace".
I suppose it's because rustfmt tries to put entire param - both pattern and type - on the same line, fails in doing so as that exceeds the max width, and gives up. Instead, it should probably fallback to something like
The text was updated successfully, but these errors were encountered: