Skip to content

\" in a comment duplicates closing parenthesis #4635

Open
@nuta

Description

@nuta

When a comment in a macro call contains \", it seems rustfmt inserts an unnecessary closing parenthesis:

Input

fn main() {
    println!("");
    println!("" /* " */);
    println!("" /* \" */);
}

Output

fn main() {
    println!("");
    println!("" /* " */));
    println!("" /* \" */));
}

Expected output

fn main() {
    println!("");
    println!("" /* " */);
    println!("" /* \" */);
}

Meta

  • rustfmt version: rustfmt 1.4.30-nightly (acd9486 2020-12-20)
  • From where did you install rustfmt?: rustup

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions