Skip to content

An extra } is added if there's a comment with an odd number of " #4806

Closed
@wtfsck

Description

@wtfsck

Describe the bug

An extra } is added when the following code is formatted

To Reproduce

Format this

enum X {
    A,
    /*"*/
}

This is the result:

enum X {
    A,
    /*"*/
    }
}

Expected behavior

Input does not change or at most the comment is moved but no extra } should be added

Meta

  • rustfmt version: rustfmt 1.4.36-stable (7de6968 2021-02-07)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: cargo fmt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions