@@ -150,6 +150,27 @@ Book][unstable-doc-cfg] and [its tracking issue][issue-doc-cfg].
150
150
[ unstable-doc-cfg ] : ../unstable-book/language-features/doc-cfg.html
151
151
[ issue-doc-cfg ] : https://github.com/rust-lang/rust/issues/43781
152
152
153
+ ### Adding your trait to the "Important Traits" dialog
154
+
155
+ Rustdoc keeps a list of a few traits that are believed to be "fundamental" to a given type when
156
+ implemented on it. These traits are intended to be the primary interface for their types, and are
157
+ often the only thing available to be documented on their types. For this reason, Rustdoc will track
158
+ when a given type implements one of these traits and call special attention to it when a function
159
+ returns one of these types. This is the "Important Traits" dialog, visible as a circle-i button next
160
+ to the function, which, when clicked, shows the dialog.
161
+
162
+ In the standard library, the traits that qualify for inclusion are ` Iterator ` , ` io::Read ` , and
163
+ ` io::Write ` . However, rather than being implemented as a hard-coded list, these traits have a
164
+ special marker attribute on them: ` #[doc(spotlight)] ` . This means that you could apply this
165
+ attribute to your own trait to include it in the "Important Traits" dialog in documentation.
166
+
167
+ The ` #[doc(spotlight)] ` attribute currently requires the ` #![feature(doc_spotlight)] ` feature gate.
168
+ For more information, see [ its chapter in the Unstable Book] [ unstable-spotlight ] and [ its tracking
169
+ issue] [ issue-spotlight ] .
170
+
171
+ [ unstable-spotlight ] : ../unstable-book/language-features/doc-spotlight.html
172
+ [ issue-spotlight ] : https://github.com/rust-lang/rust/issues/45040
173
+
153
174
### Exclude certain dependencies from documentation
154
175
155
176
The standard library uses several dependencies which, in turn, use several types and traits from the
0 commit comments