Open
Description
As you can see from this diff, inline-attributes are viable and sometimes even useful (specifically: making diffs align properly, which has been an issue in Rand's lib.rs
quite a few times).
-#[cfg(feature="alloc")] use core::slice;
+#[cfg(feature = "alloc")]
+use core::slice;
rustfmt
is forcing multi-line attributes everywhere. I would like an option for inline attributes (when small).
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
rchaser53 commentedon Feb 19, 2019
I also want this feature a bit, so I send the PR.
[-]Allow inline attributes[/-][+][unstable option] inline_attribute_width[/+]soruh commentedon Feb 22, 2020
It appears like this does not work within
extern
blocks.i.e.:
should be formatted to this:
but isn't
versions:
rustfmt.toml
format_brace_macros
option #5538dhardy commentedon Oct 14, 2022
This also doesn't work within #5538.
inline_attribute_width
to more AST types #5968