Skip to content

Commit 4747bb6

Browse files
Add missing case explanation for doc inlined re-export of doc hidden item
1 parent ac91805 commit 4747bb6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Diff for: src/doc/rustdoc/src/write-documentation/re-exports.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,22 @@ pub struct Hidden;
8585
pub use self::Hidden as InlinedHidden;
8686
```
8787

88-
The same applies on re-exports themselves: if you have multiple re-exports and some of them have
88+
However, if you still want the re-export itself to be visible, you can add the `#[doc(inline)]`
89+
attribute on it:
90+
91+
```rust,ignore (inline)
92+
// This struct won't be visible.
93+
#[doc(hidden)]
94+
pub struct Hidden;
95+
96+
#[doc(inline)]
97+
pub use self::Hidden as InlinedHidden;
98+
```
99+
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+
103+
So back to `#[doc(hidden)]`: if you have multiple re-exports and some of them have
89104
`#[doc(hidden)]`, then these ones (and only these) won't appear in the documentation:
90105

91106
```rust,ignore (inline)

0 commit comments

Comments
 (0)