about summary refs log tree commit diff
path: root/src/bootstrap/builder.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-02-05 03:20:43 +0000
committerbors <bors@rust-lang.org>2020-02-05 03:20:43 +0000
commit4ff8fb9cb210a9f06e0eafc364bd12de2b67f087 (patch)
tree6f9b7c76baf956f86cb6a9f881e5908bbadb16cd /src/bootstrap/builder.rs
parent002287d25f6ef9718dbabd3e23c00b5ebcfb51c1 (diff)
parent793a5e68b4589d4168fa778c65ca9b92e0b85f62 (diff)
Auto merge of #68831 - Dylan-DPC:rollup-j6x15y9, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #68282 (Instrument C / C++ in MemorySanitizer example)
 - #68758 (Fix 59191 - ICE when macro replaces crate root with non-module item)
 - #68805 (bootstrap: fix clippy warnings)
 - #68810 (Remove Copy impl from OnceWith)
 - #68815 (remove redundant imports (clippy::single_component_path_imports))
 - #68818 (fix couple of perf related clippy warnings)
 - #68819 (Suggest `split_at_mut` on multiple mutable index access)

Failed merges:

r? @ghost
Diffstat (limited to 'src/bootstrap/builder.rs')
-rw-r--r--src/bootstrap/builder.rs24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index d9c894aa9c6..18f6fda7608 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -510,7 +510,7 @@ impl<'a> Builder<'a> {
             Subcommand::Format { .. } | Subcommand::Clean { .. } => panic!(),
         };
 
-        let builder = Builder {
+        Builder {
             build,
             top_stage: build.config.stage.unwrap_or(2),
             kind,
@@ -518,9 +518,7 @@ impl<'a> Builder<'a> {
             stack: RefCell::new(Vec::new()),
             time_spent_on_dependencies: Cell::new(Duration::new(0, 0)),
             paths: paths.to_owned(),
-        };
-
-        builder
+        }
     }
 
     pub fn execute_cli(&self) {
@@ -753,13 +751,12 @@ impl<'a> Builder<'a> {
             cargo.env("RUST_CHECK", "1");
         }
 
-        let stage;
-        if compiler.stage == 0 && self.local_rebuild {
+        let stage = if compiler.stage == 0 && self.local_rebuild {
             // Assume the local-rebuild rustc already has stage1 features.
-            stage = 1;
+            1
         } else {
-            stage = compiler.stage;
-        }
+            compiler.stage
+        };
 
         let mut rustflags = Rustflags::new(&target);
         if stage != 0 {
@@ -1252,12 +1249,7 @@ impl<'a> Builder<'a> {
         };
 
         if self.config.print_step_timings && dur > Duration::from_millis(100) {
-            println!(
-                "[TIMING] {:?} -- {}.{:03}",
-                step,
-                dur.as_secs(),
-                dur.subsec_nanos() / 1_000_000
-            );
+            println!("[TIMING] {:?} -- {}.{:03}", step, dur.as_secs(), dur.subsec_millis());
         }
 
         {
@@ -1302,7 +1294,7 @@ impl Rustflags {
 
     fn arg(&mut self, arg: &str) -> &mut Self {
         assert_eq!(arg.split_whitespace().count(), 1);
-        if self.0.len() > 0 {
+        if !self.0.is_empty() {
             self.0.push_str(" ");
         }
         self.0.push_str(arg);