Skip to content

Commit 8187fe0

Browse files
Explain how doc(cfg) and doc(auto_cfg) interacts
1 parent 4746afc commit 8187fe0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

text/000-rustdoc-cfgs-handling.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ It will be displayed exactly the same as the previous code.
101101

102102
This attribute has the same syntax as conditional compilation, but it only causes documentation to be added. This means `#[doc(cfg(not(windows)))]` will not cause your docs to be hidden on non-windows targets, even though `#[cfg(not(windows))]` does do that.
103103

104+
If `doc(auto_cfg)` is enabled on the item, `doc(cfg)` will override it anyway so in the two previous examples, even if the `doc(auto_cfg)` feature was enabled, it would still display the same thing.
105+
104106
This attribute works on modules and on items.
105107

106108
### `#[doc(auto_cfg(hide(...)))]`

0 commit comments

Comments
 (0)