diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-12-31 13:04:42 +1100 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-12-31 22:26:14 +1100 |
| commit | 66fd5340eaf1792f845e6dbfda7063c9b8d856c4 (patch) | |
| tree | d55d833f1c862c249a468b492c41cf83268c86e1 /src/bootstrap | |
| parent | 774e83cea1fb3d6ddf15f50405206ae7c9cb0761 (diff) | |
Use struct-like syntax in `tool_check_step!`
This tricks rustfmt into formatting the macro arguments as expressions, instead of giving up and ignoring them.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/check.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 1ea28901363..9434d876df8 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -401,10 +401,13 @@ impl Step for RustAnalyzer { macro_rules! tool_check_step { ( - $name:ident, - $path:literal - $(, alt_path: $alt_path:literal )* - $(, default: $default:literal )? + $name:ident { + // The part of this path after the final '/' is also used as a display name. + path: $path:literal + $(, alt_path: $alt_path:literal )* + $(, default: $default:literal )? + $( , )? + } ) => { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct $name { @@ -474,23 +477,23 @@ fn run_tool_check_step( run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false); } -tool_check_step!(Rustdoc, "src/tools/rustdoc", alt_path: "src/librustdoc"); +tool_check_step!(Rustdoc { path: "src/tools/rustdoc", alt_path: "src/librustdoc" }); // Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead // of a submodule. Since the SourceType only drives the deny-warnings // behavior, treat it as in-tree so that any new warnings in clippy will be // rejected. -tool_check_step!(Clippy, "src/tools/clippy"); -tool_check_step!(Miri, "src/tools/miri"); -tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri"); -tool_check_step!(Rls, "src/tools/rls"); -tool_check_step!(Rustfmt, "src/tools/rustfmt"); -tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools"); -tool_check_step!(TestFloatParse, "src/etc/test-float-parse"); - -tool_check_step!(Bootstrap, "src/bootstrap", default: false); +tool_check_step!(Clippy { path: "src/tools/clippy" }); +tool_check_step!(Miri { path: "src/tools/miri" }); +tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri" }); +tool_check_step!(Rls { path: "src/tools/rls" }); +tool_check_step!(Rustfmt { path: "src/tools/rustfmt" }); +tool_check_step!(MiroptTestTools { path: "src/tools/miropt-test-tools" }); +tool_check_step!(TestFloatParse { path: "src/etc/test-float-parse" }); + +tool_check_step!(Bootstrap { path: "src/bootstrap", default: false }); // Compiletest is implicitly "checked" when it gets built in order to run tests, // so this is mainly for people working on compiletest to run locally. -tool_check_step!(Compiletest, "src/tools/compiletest", default: false); +tool_check_step!(Compiletest { path: "src/tools/compiletest", default: false }); /// Cargo's output path for the standard library in a given stage, compiled /// by a particular compiler for the specified target. |
