-
Notifications
You must be signed in to change notification settings - Fork 910
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
rustfmt makes it impossible to explain attributes with comments in the same line #4573
Comments
This is currently nightly-2020-11-19 (you can tell by looking at |
This looks very similar to #3255 -- in both cases rustfmt changes comment-after-code to move the comment onto its own line, thus changing the semantic meaning of the comment. IMO rustfmt should never do this. |
I'm unable to reproduce this on |
I don't recall anything offhand, though it is getting a bit late in the day. Could you make sure you're testing locally with the same configuration settings that are used in the rust-lang/rust repo? |
Closed as this does appear to be sorted, but please let us know if you see a recurrence @RalfJung |
Input
Sometimes an attribute needs a comment explaining why it exists:
Output
Unfortunately rustfmt insists on putting the comment on a separate line (and it moves it after the attribute, which is even worse):
Expected output
Just like I can have comments to the right of code, explaining what the code does, I expect to have comments to the right of attributes, explaining what the attributes do:
Meta
./x.py fmt
does in rustcThe text was updated successfully, but these errors were encountered: