Skip to content

Fmt failure with wrap_comments = true #5493

Open
@sander2

Description

@sander2

When having wrap_comments = true, running rustfmt on the following code produces an error:

fn f() {
    g({
        // some trailing spaces on the line below - this needs to be inside the g call
    
        SomeStruct {
            a: b, // // This needs two sets of the slash-slash comments, and this needs to be a very long sentence so bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
        };
    })
    .x; // the .something needs to be here
}

The produces error is error[internal]: left behind trailing whitespace

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-chainsa-commentse-max widtherror[internal]: line formatted, but exceeded maximum widthe-trailing whitespaceerror[internal]: left behind trailing whitespace

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions