Skip to content

\" in a comment duplicates closing parenthesis #4635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nuta opened this issue Jan 10, 2021 · 0 comments · May be fixed by #5469
Open

\" in a comment duplicates closing parenthesis #4635

nuta opened this issue Jan 10, 2021 · 0 comments · May be fixed by #5469

Comments

@nuta
Copy link

nuta commented Jan 10, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants