File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ Prefer line comments (`///`) to block comments (`//* ... */`).
8181Prefer outer doc comments (` /// ` or ` //* ` ), only use inner doc comments (` //! `
8282and ` //*! ` ) to write module-level or crate-level documentation.
8383
84+ Doc comments should come before attributes.
8485
8586### Attributes
8687
@@ -100,6 +101,11 @@ struct CRepr {
100101}
101102```
102103
104+ There must only be a single ` derive ` attribute. Note for tool authors: if
105+ combining multiple ` derive ` attributes into a single attribute, the ordering of
106+ the derived names should be preserved. E.g., `#[ derive(bar)] #[ derive(foo)]
107+ struct Baz;` should be formatted to ` #[ derive(bar, foo)] struct Baz;`.
108+
103109## [ Non-formatting conventions] ( advice.md )
104110
105111## [ Cargo.toml conventions] ( cargo.md )
You can’t perform that action at this time.
0 commit comments