rustfmt removes inner attributes from inline const blocks #6158
Labels
bug
Panic, non-idempotency, invalid code, etc.
good first issue
Issues up for grabs, also good candidates for new rustfmt contributors
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: