-
Notifications
You must be signed in to change notification settings - Fork 898
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
fmt gives up on some pub const fields in types #5194
Comments
Thanks for submitting the report! I think the trailing comment not sticking with the impl item is partially related to #4027, #5168, #3720. Those linked issues deal with When you get a chance, could you please provide an example without comments to better highlight the issue you're describing. |
This is a duplicate of #5099 so going to close accordingly |
hey @calebcartwright well if you think this is a duplicate of that one it probably is.
It seems to me that comments here are the causing factor, when I was testing it without comments it seems to work.
Results in...
I was not able reproduce the comment behavior earlier because it turns out it's related to my config:
It's the |
using rustfmt 1.4.38-nightly (777bb86 2022-01-20)
Example code:
rustfmt fails to format above for field D.
However if I try to put the:
mem::size_of::<i64>() // field A
on the next line rustfmt does put it back in there.it also formats foo() in this function as expected so I am invoking it correctly.
In my other tests it sort of put the comment for field H in a totally odd location I had rustfmt give me something like this:
(unable to produce MVE for this, but I did not try hard )
The text was updated successfully, but these errors were encountered: