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 on items in extern block are deleted #4533

Closed
Aaron1011 opened this issue Nov 17, 2020 · 1 comment
Closed

Comments on items in extern block are deleted #4533

Aaron1011 opened this issue Nov 17, 2020 · 1 comment
Labels
bug Panic, non-idempotency, invalid code, etc. duplicate

Comments

@Aaron1011
Copy link
Member

Describe the bug

When a normal comment (non-doc-comment) is applied to an item in an extern block, rustfmt will delete it.

To Reproduce

The following code:

extern "C" {
    // A comment
    fn bar();
}

is formatted as:

extern "C" {
    fn bar();
}

Expected behavior

rustfmt should leave the comment intact

Meta

  • rustfmt version: rustfmt 1.4.26-nightly (293d7d0 2020-11-14)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: rustfmt
@Aaron1011 Aaron1011 added the bug Panic, non-idempotency, invalid code, etc. label Nov 17, 2020
@calebcartwright
Copy link
Member

Duplicate of #4528, fixed in the next nightly (rust-lang/rust#79120)

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

No branches or pull requests

2 participants