Auto merge of #96000 - jyn514:faster-doctests, r=Mark-Simulacrum

Make `x test --stage 2 compiler/rustc_XXX` faster to run

Previously, bootstrap unconditionally rebuilt the stage 2 compiler,
even if it had previously built stage 1. This changes it to reuse stage 1 if possible.
In particular, it no longer runs the following step:
```
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu))
```
This commit is contained in:
bors 2022-04-18 04:15:26 +00:00
commit 74582acd3b

View file

@ -1892,7 +1892,8 @@ impl Step for CrateLibrustc {
fn make_run(run: RunConfig<'_>) {
let builder = run.builder;
let compiler = builder.compiler(builder.top_stage, run.build_triple());
let host = run.build_triple();
let compiler = builder.compiler_for(builder.top_stage, host, host);
let krate = builder.crate_paths[&run.path];
let test_kind = builder.kind.into();
@ -1929,7 +1930,8 @@ impl Step for Crate {
fn make_run(run: RunConfig<'_>) {
let builder = run.builder;
let compiler = builder.compiler(builder.top_stage, run.build_triple());
let host = run.build_triple();
let compiler = builder.compiler_for(builder.top_stage, host, host);
let test_kind = builder.kind.into();
let krate = builder.crate_paths[&run.path];