Skip to content

Trailing comments break subsequent comments #3792

Closed
@gnzlbg

Description

@gnzlbg

I have a rustfmt.toml like this:

max_width = 79
comment_width = 79
error_on_line_overflow = true

and a line like this:

pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast
// Multicast using broadcst. add.

gets incorrectly formatted into a line like this

pub const IFF_MULTICAST: ::c_int = 0x0000000800; // Supports multicast
                                                 // Multicast using broadcst. add.

notice that the comment is incorrectly wrapped to the right, and that as a consequence the 79 character limit is not satisfied after formatting, such that a subsequent rustfmt --check fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsbugPanic, non-idempotency, invalid code, etc.only-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions