-
Notifications
You must be signed in to change notification settings - Fork 883
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 removes inner attributes from inline const blocks #6158
Comments
I think the issue here is that the inner attributes are stored on the outer We can probably solve this by matching on the Lines 141 to 143 in d5f1200
|
@rustbot claim |
Clippy unfortunately warns about asserts whose conditions can be evaluated at compile-time even in inline const blocks. It's a known issue, it'll hopefully be solved at some point.
In the meantime, if one wishes to perform such compile-time asserts without disabling the lint globally, one can simply allow the offending lint:
Unfortunately, running rustfmt on the above will simply remove the attribute (try it on the playground), resulting in:
And then Clippy nags at us again :'(
With inline const blocks due to being stabilized for 1.79 (in 6 weeks), it would be nice to fix rustfmt to not eat their code away.
Meta
rustfmt version:
The text was updated successfully, but these errors were encountered: