Rollup merge of #149623 - jieyouxu:redundant-tool-test-step, r=Zalathar

Don't require a normal tool build of clippy/rustfmt when running their test steps

This is redundant and wasteful.

Noticed in https://github.com/rust-lang/rust/pull/147372#discussion_r2585886897.
This commit is contained in:
Matthias Krüger
2025-12-04 16:07:56 +01:00
committed by GitHub
+3 -6
View File
@@ -524,8 +524,7 @@ fn make_run(run: RunConfig<'_>) {
/// Runs `cargo test` for rustfmt.
fn run(self, builder: &Builder<'_>) {
let tool_result = builder.ensure(tool::Rustfmt::from_compilers(self.compilers));
let build_compiler = tool_result.build_compiler;
let build_compiler = self.compilers.build_compiler();
let target = self.compilers.target();
let mut cargo = tool::prepare_tool_cargo(
@@ -869,11 +868,9 @@ fn run(self, builder: &Builder<'_>) {
// We need to carefully distinguish the compiler that builds clippy, and the compiler
// that is linked into the clippy being tested. `target_compiler` is the latter,
// and it must also be used by clippy's test runner to build tests and their dependencies.
let compilers = self.compilers;
let target_compiler = compilers.target_compiler();
let target_compiler = self.compilers.target_compiler();
let build_compiler = self.compilers.build_compiler();
let tool_result = builder.ensure(tool::Clippy::from_compilers(compilers));
let build_compiler = tool_result.build_compiler;
let mut cargo = tool::prepare_tool_cargo(
builder,
build_compiler,