Skip to content

Commit b0b7b1e

Browse files
authored
Rollup merge of #112234 - ozkanonur:hotfix, r=albertlarsan68
extend `tool_doc!` with `only_libs` arg resolves #112211 (comment)
2 parents e63e96d + 8b7e794 commit b0b7b1e

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/bootstrap/doc.rs

+23-3
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,16 @@ impl Step for Rustc {
746746
}
747747

748748
macro_rules! tool_doc {
749-
($tool: ident, $should_run: literal, $path: literal, $(rustc_tool = $rustc_tool:literal, )? $(in_tree = $in_tree:literal, )? [$($krate: literal),+ $(,)?] $(,)?) => {
749+
(
750+
$tool: ident,
751+
$should_run: literal,
752+
$path: literal,
753+
$(rustc_tool = $rustc_tool:literal, )?
754+
$(in_tree = $in_tree:literal, )?
755+
$(only_libs = $only_libs:literal, )?
756+
[$($krate: literal),+ $(,)?]
757+
$(,)?
758+
) => {
750759
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
751760
pub struct $tool {
752761
target: TargetSelection,
@@ -834,7 +843,11 @@ macro_rules! tool_doc {
834843
cargo.arg("-Zskip-rustdoc-fingerprint");
835844
// Only include compiler crates, no dependencies of those, such as `libc`.
836845
cargo.arg("--no-deps");
837-
cargo.arg("--lib");
846+
847+
if false $(|| $only_libs)? {
848+
cargo.arg("--lib");
849+
}
850+
838851
$(
839852
cargo.arg("-p").arg($krate);
840853
)+
@@ -886,7 +899,14 @@ tool_doc!(
886899
]
887900
);
888901
tool_doc!(Tidy, "tidy", "src/tools/tidy", rustc_tool = false, ["tidy"]);
889-
tool_doc!(Bootstrap, "bootstrap", "src/bootstrap", rustc_tool = false, ["bootstrap"]);
902+
tool_doc!(
903+
Bootstrap,
904+
"bootstrap",
905+
"src/bootstrap",
906+
rustc_tool = false,
907+
only_libs = true,
908+
["bootstrap"]
909+
);
890910

891911
#[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)]
892912
pub struct ErrorIndex {

0 commit comments

Comments
 (0)