Skip to content

Commit 45a69cc

Browse files
committed
Add in_tree macro literal
Signed-off-by: InfRandomness <[email protected]>
1 parent dbe77e8 commit 45a69cc

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/bootstrap/doc.rs

+18-5
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ impl Step for Rustc {
643643
}
644644

645645
macro_rules! tool_doc {
646-
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(,)?) => {
646+
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], in_tree = $in_tree:expr $(,)?) => {
647647
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
648648
pub struct $tool {
649649
target: TargetSelection,
@@ -699,6 +699,12 @@ macro_rules! tool_doc {
699699
t!(fs::create_dir_all(&out_dir));
700700
t!(symlink_dir_force(&builder.config, &out, &out_dir));
701701

702+
let source_type = if $in_tree == true {
703+
SourceType::InTree
704+
} else {
705+
SourceType::Submodule
706+
};
707+
702708
// Build cargo command.
703709
let mut cargo = prepare_tool_cargo(
704710
builder,
@@ -707,7 +713,7 @@ macro_rules! tool_doc {
707713
target,
708714
"doc",
709715
$path,
710-
SourceType::InTree,
716+
source_type,
711717
&[],
712718
);
713719

@@ -729,15 +735,22 @@ macro_rules! tool_doc {
729735
}
730736
}
731737

732-
tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]);
738+
tool_doc!(
739+
Rustdoc,
740+
"rustdoc-tool",
741+
"src/tools/rustdoc",
742+
["rustdoc", "rustdoc-json-types"],
743+
in_tree = true
744+
);
733745
tool_doc!(
734746
Rustfmt,
735747
"rustfmt-nightly",
736748
"src/tools/rustfmt",
737749
["rustfmt-nightly", "rustfmt-config_proc_macro"],
750+
in_tree = true
738751
);
739-
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"]);
740-
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"]);
752+
tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"], in_tree = true);
753+
tool_doc!(Miri, "miri", "src/tools/miri", ["miri"], in_tree = false);
741754

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

0 commit comments

Comments
 (0)