Skip to content

Commit e30eb4d

Browse files
Rollup merge of #86913 - Stupremee:document-rustdoc-private-items, r=jyn514
Document rustdoc with `--document-private-items` The `tool_doc` macro introduced in #86737 did not use `false` as the default value for `binary` when it is not provided, so the `if` is not even expanded and thus the argument is never provided if the `binary` argument isn't. Resolves #86900 r? ```@Mark-Simulacrum```
2 parents 46314f7 + 27b55e6 commit e30eb4d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/bootstrap/doc.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ impl Step for Rustc {
600600
}
601601

602602
macro_rules! tool_doc {
603-
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(, binary=$bin:expr)?) => {
603+
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], binary=$bin:expr) => {
604604
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
605605
pub struct $tool {
606606
stage: u32,
@@ -669,9 +669,9 @@ macro_rules! tool_doc {
669669
cargo.arg("-p").arg($krate);
670670
)+
671671

672-
$(if !$bin {
672+
if !$bin {
673673
cargo.rustdocflag("--document-private-items");
674-
})?
674+
}
675675
cargo.rustdocflag("--enable-index-page");
676676
cargo.rustdocflag("--show-type-layout");
677677
cargo.rustdocflag("-Zunstable-options");
@@ -681,7 +681,13 @@ macro_rules! tool_doc {
681681
}
682682
}
683683

684-
tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]);
684+
tool_doc!(
685+
Rustdoc,
686+
"rustdoc-tool",
687+
"src/tools/rustdoc",
688+
["rustdoc", "rustdoc-json-types"],
689+
binary = false
690+
);
685691
tool_doc!(
686692
Rustfmt,
687693
"rustfmt-nightly",

0 commit comments

Comments
 (0)