Skip to content

Trailing whitespace of match arm not stripped when the body expression is very long and follows in the second line #5689

Open
@jinohkang-theori

Description

@jinohkang-theori

Minimal reproducer:

fn this_is_a_very_long_name_to_lengthen_the_expression_so_that_rustfmt_does_not_join_the_lines() {}

fn main() {
    match () {
        _ => /* (whitespace here) => */ 
            this_is_a_very_long_name_to_lengthen_the_expression_so_that_rustfmt_does_not_join_the_lines(),
    }
}

Output:

error[internal]: left behind trailing whitespace
 --> stdin:5:5:40
  |
5 |         _ => /* (whitespace here) => */ 
  |                                        ^
  |

warning: rustfmt has failed to format. See previous 1 errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions