We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I write this code:
struct Abc([u8; // five 5 + // ten 10 + // thirteen 13 ]);
rustfmt formats this to:
struct Abc( [u8; 5 + // ten 10 + // thirteen 13], );
It has lost the // five comment. The remainder of the formatting is not great.
// five
playground
version:
rustfmt 1.8.0-stable (90b35a6239 2024-11-26)
The text was updated successfully, but these errors were encountered:
A workaround is to surround the expression in const { .. }
const { .. }
edit: although a comment before the const is still removed:
const
struct Abc( [u8; // blorp const { // five 5 + // ten 10 + // thirteen 13 }], );
is formatted to:
struct Abc( [u8; const { // five 5 + // ten 10 + // thirteen 13 }], );
Sorry, something went wrong.
Thanks for the report. This is related to #5297, except the error occurs in expression rewriting:
rustfmt/src/expr.rs
Lines 284 to 291 in a43eef1
No branches or pull requests
I write this code:
rustfmt formats this to:
It has lost the
// five
comment. The remainder of the formatting is not great.playground
version:
The text was updated successfully, but these errors were encountered: