]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/builder.rs
Auto merge of #106301 - notriddle:notriddle/dir-entry, r=GuillaumeGomez
[rust.git] / src / bootstrap / builder.rs
index 97b353b5462f5d2524f6b85a0fb24ee7a253042e..b54bf43262198e558353410c81d9ae201aeb020f 100644 (file)
@@ -97,13 +97,13 @@ pub fn build_triple(&self) -> TargetSelection {
         self.builder.build.build
     }
 
-    /// Return a `-p=x -p=y` string suitable for passing to a cargo invocation.
+    /// Return a list of crate names selected by `run.paths`.
     pub fn cargo_crates_in_set(&self) -> Interned<Vec<String>> {
         let mut crates = Vec::new();
         for krate in &self.paths {
             let path = krate.assert_single_path();
             let crate_name = self.builder.crate_paths[&path.path];
-            crates.push(format!("-p={crate_name}"));
+            crates.push(crate_name.to_string());
         }
         INTERNER.intern_list(crates)
     }
@@ -112,18 +112,17 @@ pub fn cargo_crates_in_set(&self) -> Interned<Vec<String>> {
 /// A description of the crates in this set, suitable for passing to `builder.info`.
 ///
 /// `crates` should be generated by [`RunConfig::cargo_crates_in_set`].
-pub fn crate_description(crates: Interned<Vec<String>>) -> String {
+pub fn crate_description(crates: &[impl AsRef<str>]) -> String {
     if crates.is_empty() {
         return "".into();
     }
 
-    let mut descr = String::from(": {");
-    for krate in &*crates {
-        write!(descr, "{}, ", krate.strip_prefix("-p=").unwrap()).unwrap();
+    let mut descr = String::from(" {");
+    descr.push_str(crates[0].as_ref());
+    for krate in &crates[1..] {
+        descr.push_str(", ");
+        descr.push_str(krate.as_ref());
     }
-
-    descr.pop();
-    descr.pop();
     descr.push('}');
     descr
 }
@@ -663,6 +662,7 @@ macro_rules! describe {
                 crate::toolstate::ToolStateCheck,
                 test::ExpandYamlAnchors,
                 test::Tidy,
+                test::TidySelfTest,
                 test::Ui,
                 test::RunPassValgrind,
                 test::MirOpt,