From 36c3f90173f404b84174a19ba76a33dbfd6ad985 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 25 Oct 2023 22:33:40 +1100 Subject: [PATCH] For run-coverage tests, build `rust-demangler` with the stage 0 compiler This avoids useless rebuilds of the demangler when modifying the compiler. --- src/bootstrap/src/core/build_steps/test.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index f2284b8a4ba..0668d07ed06 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1568,9 +1568,11 @@ fn run(self, builder: &Builder<'_>) { } if mode == "run-coverage" { + // The demangler doesn't need the current compiler, so we can avoid + // unnecessary rebuilds by using the bootstrap compiler instead. let rust_demangler = builder .ensure(tool::RustDemangler { - compiler, + compiler: compiler.with_stage(0), target: compiler.host, extra_features: Vec::new(), })