Skip to content

Commit a82da26

Browse files
committed
Include feature-gated items in bootstrap tool docs
This sets `--all-features` when documenting bootstrap tool crates, and enables rustdoc's `#![feature(doc_cfg)]` to display which items are feature-gated.
1 parent e86e199 commit a82da26

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • src/bootstrap/src/core/build_steps

‎src/bootstrap/src/core/build_steps/doc.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,11 @@ fn document_tool(
11711171
}
11721172
}
11731173

1174+
// Tell rustdoc to document which items require feature flags.
1175+
cargo.arg("--all-features");
1176+
cargo.allow_features("doc_cfg");
1177+
cargo.rustdocflag("-Zcrate-attr=feature(doc_cfg)");
1178+
11741179
cargo.rustdocflag("--document-private-items");
11751180
// Since we always pass --document-private-items, there's no need to warn about linking to private items.
11761181
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");

0 commit comments

Comments
 (0)