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 (`//* ... */`).
81
81
Prefer outer doc comments (` /// ` or ` //* ` ), only use inner doc comments (` //! `
82
82
and ` //*! ` ) to write module-level or crate-level documentation.
83
83
84
+ Doc comments should come before attributes.
84
85
85
86
### Attributes
86
87
@@ -100,6 +101,11 @@ struct CRepr {
100
101
}
101
102
```
102
103
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
+
103
109
## [ Non-formatting conventions] ( advice.md )
104
110
105
111
## [ Cargo.toml conventions] ( cargo.md )
You can’t perform that action at this time.
0 commit comments