summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-30 06:29:39 +0000
committerbors <bors@rust-lang.org>2018-07-30 06:29:39 +0000
commit7bbcd005b30582d07f1a39dcf50f77b54e055828 (patch)
treeee814e901b90440bc7b76ab13bdbb7468b3b17de /src/bootstrap
parenta3f519df09bf40d09c1a111599b8f115f11fbb49 (diff)
parent421b2ba347a3a1afa41b91f4254f238c790fd73b (diff)
downloadrust-7bbcd005b30582d07f1a39dcf50f77b54e055828.tar.gz
rust-7bbcd005b30582d07f1a39dcf50f77b54e055828.zip
Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkov
Don't format!() string literals

Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/dist.rs16
-rw-r--r--src/bootstrap/doc.rs4
-rw-r--r--src/bootstrap/native.rs2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 7b4808ef018..c6b39a52ae1 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -94,7 +94,7 @@ impl Step for Docs {
 
         builder.info(&format!("Dist docs ({})", host));
         if !builder.config.docs {
-            builder.info(&format!("\tskipping - docs disabled"));
+            builder.info("\tskipping - docs disabled");
             return distdir(builder).join(format!("{}-{}.tar.gz", name, host));
         }
 
@@ -156,7 +156,7 @@ impl Step for RustcDocs {
 
         builder.info(&format!("Dist compiler docs ({})", host));
         if !builder.config.compiler_docs {
-            builder.info(&format!("\tskipping - compiler docs disabled"));
+            builder.info("\tskipping - compiler docs disabled");
             return distdir(builder).join(format!("{}-{}.tar.gz", name, host));
         }
 
@@ -639,7 +639,7 @@ impl Step for Std {
         // The only true set of target libraries came from the build triple, so
         // let's reduce redundant work by only producing archives from that host.
         if compiler.host != builder.config.build {
-            builder.info(&format!("\tskipping, not a build host"));
+            builder.info("\tskipping, not a build host");
             return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
         }
 
@@ -715,11 +715,11 @@ impl Step for Analysis {
         let compiler = self.compiler;
         let target = self.target;
         assert!(builder.config.extended);
-        builder.info(&format!("Dist analysis"));
+        builder.info("Dist analysis");
         let name = pkgname(builder, "rust-analysis");
 
         if &compiler.host != builder.config.build {
-            builder.info(&format!("\tskipping, not a build host"));
+            builder.info("\tskipping, not a build host");
             return distdir(builder).join(format!("{}-{}.tar.gz", name, target));
         }
 
@@ -824,7 +824,7 @@ impl Step for Src {
 
     /// Creates the `rust-src` installer component
     fn run(self, builder: &Builder) -> PathBuf {
-        builder.info(&format!("Dist src"));
+        builder.info("Dist src");
 
         let name = pkgname(builder, "rust-src");
         let image = tmpdir(builder).join(format!("{}-image", name));
@@ -918,7 +918,7 @@ impl Step for PlainSourceTarball {
 
     /// Creates the plain source tarball
     fn run(self, builder: &Builder) -> PathBuf {
-        builder.info(&format!("Create plain source tarball"));
+        builder.info("Create plain source tarball");
 
         // Make sure that the root folder of tarball has the correct name
         let plain_name = format!("{}-src", pkgname(builder, "rustc"));
@@ -998,7 +998,7 @@ impl Step for PlainSourceTarball {
         if let Some(dir) = tarball.parent() {
             builder.create_dir(&dir);
         }
-        builder.info(&format!("running installer"));
+        builder.info("running installer");
         let mut cmd = rust_installer(builder);
         cmd.arg("tarball")
            .arg("--input").arg(&plain_name)
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs
index fd3730ffc78..9dbbe6bcfe4 100644
--- a/src/bootstrap/doc.rs
+++ b/src/bootstrap/doc.rs
@@ -686,7 +686,7 @@ impl Step for Rustc {
         };
 
         if !builder.config.compiler_docs {
-            builder.info(&format!("\tskipping - compiler/librustdoc docs disabled"));
+            builder.info("\tskipping - compiler/librustdoc docs disabled");
             return;
         }
 
@@ -788,7 +788,7 @@ impl Step for Rustdoc {
         };
 
         if !builder.config.compiler_docs {
-            builder.info(&format!("\tskipping - compiler/librustdoc docs disabled"));
+            builder.info("\tskipping - compiler/librustdoc docs disabled");
             return;
         }
 
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 264acfacee6..9aeb4e0edae 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -474,7 +474,7 @@ impl Step for TestHelpers {
         }
 
         let _folder = builder.fold_output(|| "build_test_helpers");
-        builder.info(&format!("Building test helpers"));
+        builder.info("Building test helpers");
         t!(fs::create_dir_all(&dst));
         let mut cfg = cc::Build::new();