Skip to content

Commit 870c1aa

Browse files
committed
Fix explanation for doc inlined re-export of doc hidden item
Signed-off-by: xizheyin <[email protected]>
1 parent 2010bba commit 870c1aa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/doc/rustdoc/src/write-documentation/re-exports.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ pub mod public_mod {
7474
pub use self::public_mod::Public;
7575
```
7676

77-
If an item has `#[doc(hidden)]`, it won't be inlined (nor visible in the generated documentation):
77+
If an item has a reexport chain with `#[doc(hidden)]`,
78+
and the item has no other attributes,
79+
it won't be visible in the generated documentation:
7880

7981
```rust,ignore (inline)
8082
// This struct won't be visible.
@@ -97,8 +99,7 @@ pub struct Hidden;
9799
pub use self::Hidden as InlinedHidden;
98100
```
99101

100-
In this case, you will have `pub use self::Hidden as InlinedHidden;` in the generated documentation
101-
but no link to the `Hidden` item.
102+
In this case, you will have `Hidden` inlined as `InlineHidden`.
102103

103104
So back to `#[doc(hidden)]`: if you have multiple re-exports and some of them have
104105
`#[doc(hidden)]`, then these ones (and only these) won't appear in the documentation:

0 commit comments

Comments
 (0)