Skip to content

Single-line where clauses may be 1 character too long #5990

Open
@kpreid

Description

@kpreid

With default settings, rustfmt thinks the following code is formatted:

//-------1---------2---------3---------4---------5---------6---------7---------8---------9---------!
//34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
impl<E> Tt for Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa where E: Tttttttttttttttttttttttttttttttttt1
{}

But the impl header is 101 characters long. If it is made any longer, rustfmt will correctly wrap it to the next line, but at this exact length, rustfmt uses single-line formatting when it shouldn't.

This may be related to #5321, which involves trait bounds but not where.

Metadata

Metadata

Assignees

No one assigned

    Labels

    e-max widtherror[internal]: line formatted, but exceeded maximum widthpoor-formatting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions