about summary refs log tree commit diff
path: root/src/bootstrap/test.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-10 06:28:40 +0000
committerbors <bors@rust-lang.org>2022-04-10 06:28:40 +0000
commit341883d051ebbfaa6daa456b198d557fa0272b71 (patch)
tree5c11f0a2ffcd042a928142decaf2800e4a7bdc58 /src/bootstrap/test.rs
parentf7b4824731483df9ac911cb5b60fe85f04162ad0 (diff)
parent72315919e66b10c1996497f780142df7b1ec0692 (diff)
Auto merge of #95502 - jyn514:doc-rustc, r=Mark-Simulacrum
Fix `x doc compiler/rustc`

This also has a few cleanups to `doc.rs`. The last two commits I don't care about, but the first commit I'd like to keep - it will be very useful for https://github.com/rust-lang/rust/issues/44293.

Fixes https://github.com/rust-lang/rust/issues/95447.
Diffstat (limited to 'src/bootstrap/test.rs')
-rw-r--r--src/bootstrap/test.rs36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 81200ba60b0..9d7ea09fc82 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -21,7 +21,6 @@ use crate::native;
 use crate::tool::{self, SourceType, Tool};
 use crate::toolstate::ToolState;
 use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
-use crate::Crate as CargoCrate;
 use crate::{envify, CLang, DocTests, GitRepo, Mode};
 
 const ADB_TEST_DIR: &str = "/data/tmp/work";
@@ -1901,19 +1900,10 @@ impl Step for CrateLibrustc {
     fn make_run(run: RunConfig<'_>) {
         let builder = run.builder;
         let compiler = builder.compiler(builder.top_stage, run.build_triple());
+        let krate = builder.crate_paths[&run.path];
+        let test_kind = builder.kind.into();
 
-        for krate in builder.in_tree_crates("rustc-main", Some(run.target)) {
-            if krate.path.ends_with(&run.path) {
-                let test_kind = builder.kind.into();
-
-                builder.ensure(CrateLibrustc {
-                    compiler,
-                    target: run.target,
-                    test_kind,
-                    krate: krate.name,
-                });
-            }
-        }
+        builder.ensure(CrateLibrustc { compiler, target: run.target, test_kind, krate });
     }
 
     fn run(self, builder: &Builder<'_>) {
@@ -1947,24 +1937,10 @@ impl Step for Crate {
     fn make_run(run: RunConfig<'_>) {
         let builder = run.builder;
         let compiler = builder.compiler(builder.top_stage, run.build_triple());
+        let test_kind = builder.kind.into();
+        let krate = builder.crate_paths[&run.path];
 
-        let make = |mode: Mode, krate: &CargoCrate| {
-            let test_kind = builder.kind.into();
-
-            builder.ensure(Crate {
-                compiler,
-                target: run.target,
-                mode,
-                test_kind,
-                krate: krate.name,
-            });
-        };
-
-        for krate in builder.in_tree_crates("test", Some(run.target)) {
-            if krate.path.ends_with(&run.path) {
-                make(Mode::Std, krate);
-            }
-        }
+        builder.ensure(Crate { compiler, target: run.target, mode: Mode::Std, test_kind, krate });
     }
 
     /// Runs all unit tests plus documentation tests for a given crate defined