File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -148,3 +148,23 @@ chapter in the Unstable Book][unstable-spotlight] and [its tracking issue][issue
148
148
149
149
[ unstable-spotlight ] : ../unstable-book/language-features/doc-spotlight.html
150
150
[ issue-spotlight ] : https://github.com/rust-lang/rust/issues/45040
151
+
152
+ ## Exclude certain dependencies from documentation
153
+
154
+ The standard library uses several dependencies which, in turn, use several types and traits from the
155
+ standard library. In addition, there are several compiler-internal crates that are not considered to
156
+ be part of the official standard library, and thus would be a distraction to include in
157
+ documentation. It's not enough to exclude their crate documentation, since information about trait
158
+ implementations appears on the pages for both the type and the trait, which can be in different
159
+ crates!
160
+
161
+ To prevent internal types from being included in documentation, the standard library adds an
162
+ attribute to their ` extern crate ` declarations: ` #[doc(masked)] ` . This causes Rustdoc to "mask out"
163
+ types from these crates when building lists of trait implementations.
164
+
165
+ The ` #[doc(masked)] ` attribute is intended to be used internally, and is governed by a feature gate.
166
+ For more information, see [ its chapter in the Unstable Book] [ unstable-masked ] and [ its tracking
167
+ issue] [ issue-masked ] .
168
+
169
+ [ unstable-masked ] : ../unstable-book/language-features/doc-masked.html
170
+ [ issue-masked ] : https://github.com/rust-lang/rust/issues/44027
You can’t perform that action at this time.
0 commit comments