Skip to content

Commit 82bd146

Browse files
talk about doc(masked)
1 parent 23a1da4 commit 82bd146

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/doc/rustdoc/src/unstable-features.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,23 @@ chapter in the Unstable Book][unstable-spotlight] and [its tracking issue][issue
148148

149149
[unstable-spotlight]: ../unstable-book/language-features/doc-spotlight.html
150150
[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

0 commit comments

Comments
 (0)