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

Silent removal of comments #6190

Closed
VorfeedCanal opened this issue Jun 7, 2024 · 1 comment
Closed

Silent removal of comments #6190

VorfeedCanal opened this issue Jun 7, 2024 · 1 comment

Comments

@VorfeedCanal
Copy link

Is it normal that cargo fmt sometimes just silently removes comments like they were not there?

Here is simple reproducer:

trait 𝔉𝔬𝔬<𝓽𝔂𝓹𝓮: ?Sized> /* : 𝔅𝔞𝔯 */ {}

Trait 𝔉𝔬𝔬 exists while 𝔅𝔞𝔯 is not yet implemented so I commented it out.

After I run it through rustfmt the output looks like this:

trait 𝔉𝔬𝔬<𝓽𝔂𝓹𝓮: ?Sized> {}

Like comment was never there. Nor warnings or any other hints that something was removed.

@calebcartwright
Copy link
Member

Thanks for reaching out, going to close as a duplicate as it's a known issue with more nuance and TBD items than one might initially suspect (e.g. rust-lang/style-team#191).

We're currently focused on critical items for Edition 2024, but I'm hopeful we can make an adjustment here to at least avoid the removal of the comment even if we're not fully prepared to format items containing comments within the header

@calebcartwright calebcartwright closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants