diff options
| author | InfRandomness <infrandomness@gmail.com> | 2022-06-06 17:21:39 +0200 |
|---|---|---|
| committer | InfRandomness <infrandomness@gmail.com> | 2022-07-03 22:30:31 +0200 |
| commit | 45a69cc215c05bfc283564c9898e9c3704de8c80 (patch) | |
| tree | 78c58dcf6144f84d1727759970f352c134b9db83 /src/bootstrap | |
| parent | dbe77e856ad5cf6298de19ce5c2730f2f631b4ef (diff) | |
Add in_tree macro literal
Signed-off-by: InfRandomness <infrandomness@gmail.com>
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/doc.rs | 23 |
1 files 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 { |
