Skip to content

Commit 66fd534

Browse files
committed
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.
1 parent 774e83c commit 66fd534

File tree

1 file changed

+18
-15
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+18
-15
lines changed

src/bootstrap/src/core/build_steps/check.rs

+18-15
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,13 @@ impl Step for RustAnalyzer {
401401

402402
macro_rules! tool_check_step {
403403
(
404-
$name:ident,
405-
$path:literal
406-
$(, alt_path: $alt_path:literal )*
407-
$(, default: $default:literal )?
404+
$name:ident {
405+
// The part of this path after the final '/' is also used as a display name.
406+
path: $path:literal
407+
$(, alt_path: $alt_path:literal )*
408+
$(, default: $default:literal )?
409+
$( , )?
410+
}
408411
) => {
409412
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
410413
pub struct $name {
@@ -474,23 +477,23 @@ fn run_tool_check_step(
474477
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
475478
}
476479

477-
tool_check_step!(Rustdoc, "src/tools/rustdoc", alt_path: "src/librustdoc");
480+
tool_check_step!(Rustdoc { path: "src/tools/rustdoc", alt_path: "src/librustdoc" });
478481
// Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead
479482
// of a submodule. Since the SourceType only drives the deny-warnings
480483
// behavior, treat it as in-tree so that any new warnings in clippy will be
481484
// rejected.
482-
tool_check_step!(Clippy, "src/tools/clippy");
483-
tool_check_step!(Miri, "src/tools/miri");
484-
tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri");
485-
tool_check_step!(Rls, "src/tools/rls");
486-
tool_check_step!(Rustfmt, "src/tools/rustfmt");
487-
tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools");
488-
tool_check_step!(TestFloatParse, "src/etc/test-float-parse");
489-
490-
tool_check_step!(Bootstrap, "src/bootstrap", default: false);
485+
tool_check_step!(Clippy { path: "src/tools/clippy" });
486+
tool_check_step!(Miri { path: "src/tools/miri" });
487+
tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri" });
488+
tool_check_step!(Rls { path: "src/tools/rls" });
489+
tool_check_step!(Rustfmt { path: "src/tools/rustfmt" });
490+
tool_check_step!(MiroptTestTools { path: "src/tools/miropt-test-tools" });
491+
tool_check_step!(TestFloatParse { path: "src/etc/test-float-parse" });
492+
493+
tool_check_step!(Bootstrap { path: "src/bootstrap", default: false });
491494
// Compiletest is implicitly "checked" when it gets built in order to run tests,
492495
// so this is mainly for people working on compiletest to run locally.
493-
tool_check_step!(Compiletest, "src/tools/compiletest", default: false);
496+
tool_check_step!(Compiletest { path: "src/tools/compiletest", default: false });
494497

495498
/// Cargo's output path for the standard library in a given stage, compiled
496499
/// by a particular compiler for the specified target.

0 commit comments

Comments
 (0)