Skip to content

[BUG] formatter removes block comments #6363

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

Closed
NishantJoshi00 opened this issue Oct 9, 2024 · 1 comment
Closed

[BUG] formatter removes block comments #6363

NishantJoshi00 opened this issue Oct 9, 2024 · 1 comment

Comments

@NishantJoshi00
Copy link

rustfmt removing block comments that are present in between field name and field type. (observed for a struct).

System Details

  • rustc: rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo: cargo 1.81.0 (2dbb1af80 2024-08-20)
  • rustfmt: rustfmt 1.7.1-stable (eeb90cda 2024-09-04)

Reproducible Example

pub struct Account {
    id: uuid::Uuid,
    account_number: String,
    holder_name: String,
    holder_ref: /* Box<super::holder::Holder> */ uuid::Uuid,
}

Let's say I have the struct that looks something like this. Now when I run cargo fmt on this, the code is transformed into:

pub struct Account {
    id: uuid::Uuid,
    account_number: String,
    holder_name: String,
    holder_ref: uuid::Uuid,
}

The formatter removes the block comment completely.

I am not super familiar with this codebase, I'll try to look around and figure out what changes might be needed for this. But it would be great if something can help me out with this.

@ytmimi
Copy link
Contributor

ytmimi commented Oct 9, 2024

Duplicate of #5464

@ytmimi ytmimi marked this as a duplicate of #5464 Oct 9, 2024
@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants