Skip to content

Naked semicolon in an empty body needs to be formatted twice #4627

Closed
@al-yisun

Description

@al-yisun
loop {
    ;
}

gets formatted to

loop {
}

which then gets formatted to

loop {}

Thus requiring two calls to rustfmt to achieve a stable state.

Expected behavior

loop {
    ;
}

should format in one step to

loop {}

Meta

  • rustfmt version: rustfmt 1.4.29-nightly (70ce1825 2020-12-04)
  • From where did you install rustfmt?: cargo
  • How do you run rustfmt: cargo fmt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions