diff options
| author | QuietMisdreavus <grey@quietmisdreavus.net> | 2018-03-14 16:40:28 -0500 |
|---|---|---|
| committer | QuietMisdreavus <grey@quietmisdreavus.net> | 2018-03-14 16:40:28 -0500 |
| commit | 82bd146d60425c3cd0c99892742f1454f5eb8191 (patch) | |
| tree | 12c994e6577f1c07a83ba00cb383b439de822f81 /src/doc | |
| parent | 23a1da4d637648ae37090f88be695de3a63cd507 (diff) | |
| download | rust-82bd146d60425c3cd0c99892742f1454f5eb8191.tar.gz rust-82bd146d60425c3cd0c99892742f1454f5eb8191.zip | |
talk about doc(masked)
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 16702239524..9f0476d4eef 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -148,3 +148,23 @@ chapter in the Unstable Book][unstable-spotlight] and [its tracking issue][issue [unstable-spotlight]: ../unstable-book/language-features/doc-spotlight.html [issue-spotlight]: https://github.com/rust-lang/rust/issues/45040 + +## Exclude certain dependencies from documentation + +The standard library uses several dependencies which, in turn, use several types and traits from the +standard library. In addition, there are several compiler-internal crates that are not considered to +be part of the official standard library, and thus would be a distraction to include in +documentation. It's not enough to exclude their crate documentation, since information about trait +implementations appears on the pages for both the type and the trait, which can be in different +crates! + +To prevent internal types from being included in documentation, the standard library adds an +attribute to their `extern crate` declarations: `#[doc(masked)]`. This causes Rustdoc to "mask out" +types from these crates when building lists of trait implementations. + +The `#[doc(masked)]` attribute is intended to be used internally, and is governed by a feature gate. +For more information, see [its chapter in the Unstable Book][unstable-masked] and [its tracking +issue][issue-masked]. + +[unstable-masked]: ../unstable-book/language-features/doc-masked.html +[issue-masked]: https://github.com/rust-lang/rust/issues/44027 |
