You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const block formatting was updated in the 1.7.1 release to address a different bug: #6173. It's unfortunate that the formatting for const blocks with outer attributes was impacted because of it, and it's something that was overlooked.
The upside here is that const blocks now behave like other kinds of blocks when they're annotated with outer attributes. See #6106 for an example with unsafe blocks.
To prevent further churn, I don't think we can go back to the one line formatting without gating the change.
If I ask
cargo fmt
from 1.81.0 to format this code, I get:Under 1.80.0 I get:
Weirdly, if I remove the lint attribute, then both 1.81.0 and 1.80.0 format the const block on a single line.
I'm on Ubuntu 22.04, with no
rustfmt.toml
and therustfmt
versions are:The text was updated successfully, but these errors were encountered: