- 
                Notifications
    
You must be signed in to change notification settings  - Fork 964
 
Open
Labels
A-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcI-max-widthIssue: formatting exceeds maximum widthIssue: formatting exceeds maximum widthSO-max_widthStable option: max_widthStable option: max_width
Description
Formatting the following code
impl Foo {
    fn foo() {
        loop {
            match (pat, self.next_token.kind) {
                (_, TokenKind::Whitespace)
                | (Pat::AnyComment, TokenKind::BlockComment { terminated: true, .. } | TokenKind::LineComment { .. }) => {
                    self.step()
                },
            }
        }
    }
}Results in:
error[internal]: line formatted, but exceeded maximum width (maximum: 120 (see `max_width` option), found: 122)
   --> \\?\F:\rust-clippy-jj\clippy_dev\src\parse\cursor.rs:104:104:121
    |
104 |                 | (Pat::AnyComment, TokenKind::BlockComment { terminated: true, .. } | TokenKind::LineComment { .. }) => {
    |                                                                                                                         ^^
    |
Config is:
max_width = 120
error_on_line_overflow = trueMaking the offending line one character longer causes it to be correctly formatted across multiple lines.
Version:
rustfmt 1.8.0-nightly (4645a79881 2025-09-17)
Metadata
Metadata
Assignees
Labels
A-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcI-max-widthIssue: formatting exceeds maximum widthIssue: formatting exceeds maximum widthSO-max_widthStable option: max_widthStable option: max_width