Skip to content

Commit ac2bf91

Browse files
committed
rustdoc book: acknowlage --document-hidden-items
1 parent 7028d93 commit ac2bf91

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/doc/rustdoc/src/command-line-arguments.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,16 @@ mod private { // this item is private and will not be documented
100100
}
101101
```
102102

103-
`--document-private-items` documents all items, even if they're not public.
103+
`--document-private-items` causes all items to be documented as if they were `pub`.
104+
105+
## `--document-hidden-items`: Show items that are `#[doc(hidden)]`
106+
107+
By default, `rustdoc` does not document items that are annotated with
108+
[`#[doc(hidden)]`](write-documentation/the-doc-attribute.html#hidden).
109+
110+
`--document-hidden-items` causes all items to be documented as if they did not have `#[doc(hidden)]`.
111+
112+
items that are hidden and private will only be documented if both `--document-hidden-items` *and* `--document-private-items` are specified.
104113

105114
## `-L`/`--library-path`: where to look for dependencies
106115

src/doc/rustdoc/src/write-documentation/the-doc-attribute.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,10 @@ If you want to know more about inlining rules, take a look at the
230230

231231
<span id="dochidden"></span>
232232

233-
Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless
234-
the `strip-hidden` pass is removed. Re-exported items where one of its ancestors has
235-
`#[doc(hidden)]` will be considered the same as private.
233+
Any item annotated with `#[doc(hidden)]` will not appear in the documentation,
234+
unless the `--document-hidden-items` flag is used.
235+
Re-exported items where one of its ancestors has
236+
`#[doc(hidden)]` will be considered hidden.
236237

237238
You can find more information in the [`re-exports` chapter](./re-exports.md).
238239

0 commit comments

Comments
 (0)