about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-18 18:03:49 +0100
committerGitHub <noreply@github.com>2020-03-18 18:03:49 +0100
commitb6f61a1f51bd87dce41cf9523a24312f66d06b79 (patch)
tree58d06260aa7b94875c1accd4efb6f27753d428e2
parent60a2d063a960ff551bab317ea88242a2a4338026 (diff)
parent287c4eb0947c5b2df63633fc71005f2bab541673 (diff)
downloadrust-b6f61a1f51bd87dce41cf9523a24312f66d06b79.tar.gz
rust-b6f61a1f51bd87dce41cf9523a24312f66d06b79.zip
Rollup merge of #70106 - ehuss:fix-tidy-fmt-twice, r=Mark-Simulacrum
Tidy: fix running rustfmt twice

`./x.py test tidy` runs rustfmt twice. This is because `Build::build` runs `execute_cli` twice (once dry, once not). This can be quite slow (and prints a bunch of things twice).

I'm not sure if this is really the best place to check the dry_run status.
-rw-r--r--src/bootstrap/format.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs
index a4acb14ee4b..1616ae15d31 100644
--- a/src/bootstrap/format.rs
+++ b/src/bootstrap/format.rs
@@ -37,6 +37,9 @@ struct RustfmtConfig {
 }
 
 pub fn format(build: &Build, check: bool) {
+    if build.config.dry_run {
+        return;
+    }
     let mut builder = ignore::types::TypesBuilder::new();
     builder.add_defaults();
     builder.select("rust");