Skip to content

Commit 90d0ce7

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 90d0ce7

File tree

1 file changed

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

1 file changed

+19
-15
lines changed

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

+19-15
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,14 @@ 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
406+
// display name, and as part of the `-check.stamp` filename.
407+
path: $path:literal
408+
$(, alt_path: $alt_path:literal )*
409+
$(, default: $default:literal )?
410+
$( , )?
411+
}
408412
) => {
409413
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
410414
pub struct $name {
@@ -474,23 +478,23 @@ fn run_tool_check_step(
474478
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
475479
}
476480

477-
tool_check_step!(Rustdoc, "src/tools/rustdoc", alt_path: "src/librustdoc");
481+
tool_check_step!(Rustdoc { path: "src/tools/rustdoc", alt_path: "src/librustdoc" });
478482
// Clippy, miri and Rustfmt are hybrids. They are external tools, but use a git subtree instead
479483
// of a submodule. Since the SourceType only drives the deny-warnings
480484
// behavior, treat it as in-tree so that any new warnings in clippy will be
481485
// 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);
486+
tool_check_step!(Clippy { path: "src/tools/clippy" });
487+
tool_check_step!(Miri { path: "src/tools/miri" });
488+
tool_check_step!(CargoMiri { path: "src/tools/miri/cargo-miri" });
489+
tool_check_step!(Rls { path: "src/tools/rls" });
490+
tool_check_step!(Rustfmt { path: "src/tools/rustfmt" });
491+
tool_check_step!(MiroptTestTools { path: "src/tools/miropt-test-tools" });
492+
tool_check_step!(TestFloatParse { path: "src/etc/test-float-parse" });
493+
494+
tool_check_step!(Bootstrap { path: "src/bootstrap", default: false });
491495
// Compiletest is implicitly "checked" when it gets built in order to run tests,
492496
// so this is mainly for people working on compiletest to run locally.
493-
tool_check_step!(Compiletest, "src/tools/compiletest", default: false);
497+
tool_check_step!(Compiletest { path: "src/tools/compiletest", default: false });
494498

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

0 commit comments

Comments
 (0)