From 45a69cc215c05bfc283564c9898e9c3704de8c80 Mon Sep 17 00:00:00 2001 From: InfRandomness Date: Mon, 6 Jun 2022 17:21:39 +0200 Subject: [PATCH] Add in_tree macro literal Signed-off-by: InfRandomness --- src/bootstrap/doc.rs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 31eda2dc984..eb29a5e9ffc 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -643,7 +643,7 @@ impl Step for Rustc { } macro_rules! tool_doc { - ($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(,)?) => { + ($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?], in_tree = $in_tree:expr $(,)?) => { #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct $tool { target: TargetSelection, @@ -699,6 +699,12 @@ macro_rules! tool_doc { t!(fs::create_dir_all(&out_dir)); t!(symlink_dir_force(&builder.config, &out, &out_dir)); + let source_type = if $in_tree == true { + SourceType::InTree + } else { + SourceType::Submodule + }; + // Build cargo command. let mut cargo = prepare_tool_cargo( builder, @@ -707,7 +713,7 @@ macro_rules! tool_doc { target, "doc", $path, - SourceType::InTree, + source_type, &[], ); @@ -729,15 +735,22 @@ macro_rules! tool_doc { } } -tool_doc!(Rustdoc, "rustdoc-tool", "src/tools/rustdoc", ["rustdoc", "rustdoc-json-types"]); +tool_doc!( + Rustdoc, + "rustdoc-tool", + "src/tools/rustdoc", + ["rustdoc", "rustdoc-json-types"], + in_tree = true +); tool_doc!( Rustfmt, "rustfmt-nightly", "src/tools/rustfmt", ["rustfmt-nightly", "rustfmt-config_proc_macro"], + in_tree = true ); -tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"]); -tool_doc!(Miri, "miri", "src/tools/miri", ["miri"]); +tool_doc!(Clippy, "clippy", "src/tools/clippy", ["clippy_utils"], in_tree = true); +tool_doc!(Miri, "miri", "src/tools/miri", ["miri"], in_tree = false); #[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct ErrorIndex {