-
Notifications
You must be signed in to change notification settings - Fork 892
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
Failure to split a line exceeding the maximum width #6202
Comments
Thanks for the report! I think the issue here is that we're not taking the trailing Lines 1852 to 1884 in 3ffd7d4
and I thinks something like this would resolve the issue: if context.config.version() == Version::Two {
// 2 for the length of " ="
pat_shape = pat_shape.sub_width(2)?
} |
Can I be assigned to this issue? I haven't contributed to rust-lang before, so I'm looking for a good first issue. |
@CalebLItalien I just assigned you. Just a tip, in the future you can comment |
Thanks for letting me know! I see that I can post questions I have on this issue here and to the Discord. Which would you recommend? @ytmimi |
The rustfmt team doesn't use Discord that much these days. You can reach out here, though the best place to ask about rustfmt development related questions is the |
Target code from example issue rust-lang#6202 Corrected indentation and use of spacing for resriting let statements Modified resrite_let to account for trailing ' =' Reduced configs down to what was necessary to reproduce issue Reduced configs down to what was necessary to reproduce issue Documented reason for modifying pat_shape to account for ' =' Moved comment to match rest of codebase's style Fixed issue with accounting for trailing ' =' in let statements
Target code from example issue rust-lang#6202 Corrected indentation and use of spacing for resriting let statements Modified resrite_let to account for trailing ' =' Reduced configs down to what was necessary to reproduce issue Reduced configs down to what was necessary to reproduce issue Documented reason for modifying pat_shape to account for ' =' Moved comment to match rest of codebase's style Fixed issue with accounting for trailing ' =' in let statements Removed trailing space Fixed issue 6202
The following code fails to format
line formatted, but exceeded maximum width
:The line causing the error is the if let pattern (122 characters). Shortening the line by one character causes the same issue. Adding one character to the line causes it to be formatted correctly.
config:
version: rustfmt 1.7.0-nightly (8337ba91 2024-06-12)
The text was updated successfully, but these errors were encountered: