Skip to content
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

Comments removed before unnecessary semicolon #4383

Closed
HactarCE opened this issue Aug 13, 2020 · 2 comments
Closed

Comments removed before unnecessary semicolon #4383

HactarCE opened this issue Aug 13, 2020 · 2 comments
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.

Comments

@HactarCE
Copy link

Describe the bug

When rustfmt deletes an unnecessary semicolon, it also deletes comments immediately before that semicolon.

Obviously this isn't a common scenario, but rustfmt should never delete comments.

To Reproduce

Try it on the Rust Playground

Expected behavior

The extraneous semicolon should be deleted but the comment should remain.

Meta

  • rustfmt version: 1.4.20-nightly (2020-08-09 48f6c32)
  • From where did you install rustfmt?: Rust Playground (also rustup)
  • How do you run rustfmt: Rust Playground (also cargo fmt)
@HactarCE HactarCE added the bug Panic, non-idempotency, invalid code, etc. label Aug 13, 2020
@ayazhafiz
Copy link
Contributor

Fixed on master since #4180

@calebcartwright
Copy link
Member

Thanks for confirming @ayazhafiz! Closing accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

3 participants