diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 9bf89e111556..27b05d9391bf 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -1008,14 +1008,15 @@ impl Step for LibcxxVersionTool { macro_rules! tool_extended { ( - $($name:ident, - $path:expr, - $tool_name:expr, - stable = $stable:expr - $(,add_bins_to_sysroot = $add_bins_to_sysroot:expr)? - ;)+) => { - $( - #[derive(Debug, Clone, Hash, PartialEq, Eq)] + $name:ident { + path: $path:expr, + tool_name: $tool_name:expr, + stable: $stable:expr + $( , add_bins_to_sysroot: $add_bins_to_sysroot:expr )? + $( , )? + } + ) => { + #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct $name { pub compiler: Compiler, pub target: TargetSelection, @@ -1063,7 +1064,6 @@ macro_rules! tool_extended { ) } } - )+ } } @@ -1109,15 +1109,33 @@ fn run_tool_build_step( } } -tool_extended!( - Cargofmt, "src/tools/rustfmt", "cargo-fmt", stable=true; - CargoClippy, "src/tools/clippy", "cargo-clippy", stable=true; - Clippy, "src/tools/clippy", "clippy-driver", stable=true, add_bins_to_sysroot = ["clippy-driver", "cargo-clippy"]; - Miri, "src/tools/miri", "miri", stable=false, add_bins_to_sysroot = ["miri"]; - CargoMiri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, add_bins_to_sysroot = ["cargo-miri"]; - Rls, "src/tools/rls", "rls", stable=true; - Rustfmt, "src/tools/rustfmt", "rustfmt", stable=true, add_bins_to_sysroot = ["rustfmt", "cargo-fmt"]; -); +tool_extended!(Cargofmt { path: "src/tools/rustfmt", tool_name: "cargo-fmt", stable: true }); +tool_extended!(CargoClippy { path: "src/tools/clippy", tool_name: "cargo-clippy", stable: true }); +tool_extended!(Clippy { + path: "src/tools/clippy", + tool_name: "clippy-driver", + stable: true, + add_bins_to_sysroot: ["clippy-driver", "cargo-clippy"] +}); +tool_extended!(Miri { + path: "src/tools/miri", + tool_name: "miri", + stable: false, + add_bins_to_sysroot: ["miri"] +}); +tool_extended!(CargoMiri { + path: "src/tools/miri/cargo-miri", + tool_name: "cargo-miri", + stable: false, + add_bins_to_sysroot: ["cargo-miri"] +}); +tool_extended!(Rls { path: "src/tools/rls", tool_name: "rls", stable: true }); +tool_extended!(Rustfmt { + path: "src/tools/rustfmt", + tool_name: "rustfmt", + stable: true, + add_bins_to_sysroot: ["rustfmt", "cargo-fmt"] +}); #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct TestFloatParse {