about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/bootstrap/config.rs18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index 147a4a38c9c..2a6b54ce055 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -859,9 +859,6 @@ impl Config {
         set(&mut config.full_bootstrap, build.full_bootstrap);
         set(&mut config.extended, build.extended);
         config.tools = build.tools;
-        if build.rustfmt.is_some() {
-            config.initial_rustfmt = build.rustfmt;
-        }
         set(&mut config.verbose, build.verbose);
         set(&mut config.sanitizers, build.sanitizers);
         set(&mut config.profiler, build.profiler);
@@ -1154,17 +1151,12 @@ impl Config {
             set(&mut config.missing_tools, t.missing_tools);
         }
 
-        config.initial_rustfmt = config.initial_rustfmt.or_else({
-            let build = config.build;
-            let initial_rustc = &config.initial_rustc;
-
-            move || {
-                // Cargo does not provide a RUSTFMT environment variable, so we
-                // synthesize it manually.
-                let rustfmt = initial_rustc.with_file_name(exe("rustfmt", build));
+        config.initial_rustfmt = build.rustfmt.or_else(|| {
+            // Cargo does not provide a RUSTFMT environment variable, so we
+            // synthesize it manually.
+            let rustfmt = config.initial_rustc.with_file_name(exe("rustfmt", config.build));
 
-                if rustfmt.exists() { Some(rustfmt) } else { None }
-            }
+            if rustfmt.exists() { Some(rustfmt) } else { None }
         });
 
         // Now that we've reached the end of our configuration, infer the