Skip to content

Commit 12d4f08

Browse files
Rollup merge of rust-lang#112234 - ozkanonur:hotfix, r=jyn514
refactor `tool_doc!` resolves rust-lang#112211 (comment)
2 parents 302bffd + cde54ff commit 12d4f08

File tree

1 file changed

+41
-9
lines changed

1 file changed

+41
-9
lines changed

src/bootstrap/doc.rs

+41-9
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,15 @@ impl Step for Rustc {
751751
}
752752

753753
macro_rules! tool_doc {
754-
($tool: ident, $should_run: literal, $path: literal, $(rustc_tool = $rustc_tool:literal, )? $(in_tree = $in_tree:literal, )? [$($krate: literal),+ $(,)?] $(,)?) => {
754+
(
755+
$tool: ident,
756+
$should_run: literal,
757+
$path: literal,
758+
$(rustc_tool = $rustc_tool:literal, )?
759+
$(in_tree = $in_tree:literal, )?
760+
[$($extra_arg: literal),+ $(,)?]
761+
$(,)?
762+
) => {
755763
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
756764
pub struct $tool {
757765
target: TargetSelection,
@@ -832,9 +840,9 @@ macro_rules! tool_doc {
832840
cargo.arg("-Zskip-rustdoc-fingerprint");
833841
// Only include compiler crates, no dependencies of those, such as `libc`.
834842
cargo.arg("--no-deps");
835-
cargo.arg("--lib");
843+
836844
$(
837-
cargo.arg("-p").arg($krate);
845+
cargo.arg($extra_arg);
838846
)+
839847

840848
cargo.rustdocflag("--document-private-items");
@@ -850,41 +858,65 @@ macro_rules! tool_doc {
850858
}
851859
}
852860

853-
tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"],);
861+
tool_doc!(
862+
Rustdoc,
863+
"rustdoc-tool",
864+
"src/tools/rustdoc",
865+
["-p", "rustdoc", "-p", "rustdoc-json-types"]
866+
);
854867
tool_doc!(
855868
Rustfmt,
856869
"rustfmt-nightly",
857870
"src/tools/rustfmt",
858-
["rustfmt-nightly", "rustfmt-config_proc_macro"],
871+
["-p", "rustfmt-nightly", "-p", "rustfmt-config_proc_macro"],
859872
);
860-
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"]);
861-
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"]);
873+
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["-p", "clippy_utils"]);
874+
tool_doc!(Miri, "miri", "src/tools/miri", ["-p", "miri"]);
862875
tool_doc!(
863876
Cargo,
864877
"cargo",
865878
"src/tools/cargo",
866879
rustc_tool = false,
867880
in_tree = false,
868881
[
882+
"-p",
869883
"cargo",
884+
"-p",
870885
"cargo-platform",
886+
"-p",
871887
"cargo-util",
888+
"-p",
872889
"crates-io",
890+
"-p",
873891
"cargo-test-macro",
892+
"-p",
874893
"cargo-test-support",
894+
"-p",
875895
"cargo-credential",
896+
"-p",
876897
"cargo-credential-1password",
898+
"-p",
877899
"mdman",
878900
// FIXME: this trips a license check in tidy.
901+
// "-p",
879902
// "resolver-tests",
880903
// FIXME: we should probably document these, but they're different per-platform so we can't use `tool_doc`.
904+
// "-p",
881905
// "cargo-credential-gnome-secret",
906+
// "-p",
882907
// "cargo-credential-macos-keychain",
908+
// "-p",
883909
// "cargo-credential-wincred",
884910
]
885911
);
886-
tool_doc!(Tidy, "tidy", "src/tools/tidy", rustc_tool = false, ["tidy"]);
887-
tool_doc!(Bootstrap, "bootstrap", "src/bootstrap", rustc_tool = false, ["bootstrap"]);
912+
tool_doc!(Tidy, "tidy", "src/tools/tidy", rustc_tool = false, ["-p", "tidy"]);
913+
tool_doc!(
914+
Bootstrap,
915+
"bootstrap",
916+
"src/bootstrap",
917+
rustc_tool = false,
918+
["--lib", "-p", "bootstrap"]
919+
);
888920

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

0 commit comments

Comments
 (0)