rustfmt
rustfmt copied to clipboard
`merge_derives` removes trailing comments on multi-line derives
Without merge_derives, rustfmt leaves the following code as-is:
#[repr(u8)]
#[derive(
Copy,
Clone,
Component,
Serialize,
Deserialize,
Debug,
Hash,
PartialOrd,
Ord,
PartialEq,
Eq,
IntEnum,
Sequence,
Reflect,
)]
pub struct Waymark {}
Actual behaviour:
With merge_derives, however, the trailing comma after Reflect is removed.
Expected behaviour
The presence or absence of a trailing comma should not be dependent on merge_derives.
Notes
This isn't that big a deal, because the whole point of turning this option on is to avoid vertical derive layout.
@spectria-limina Thanks for reaching out. I'm having trouble reproducing the trailing comma issue that you've described. Are there maybe other configuration options that you're using? merge_derives=true is configured by default. It would also be helpful to know what version of rustfmt you're using.