]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/builder.rs
Auto merge of #68664 - tspiteri:no_run-complete-build, r=nikomatsakis
[rust.git] / src / bootstrap / builder.rs
index d9c894aa9c6b1d6a32023c99201e01528246b3cd..18f6fda760846ac4f2d949a74543d9d66820abc8 100644 (file)
@@ -510,7 +510,7 @@ pub fn new(build: &Build) -> Builder<'_> {
             Subcommand::Format { .. } | Subcommand::Clean { .. } => panic!(),
         };
 
-        let builder = Builder {
+        Builder {
             build,
             top_stage: build.config.stage.unwrap_or(2),
             kind,
@@ -518,9 +518,7 @@ pub fn new(build: &Build) -> Builder<'_> {
             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 @@ pub fn cargo(
             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 @@ pub fn ensure<S: Step>(&'a self, step: S) -> S::Output {
         };
 
         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 @@ fn env(&mut self, env: &str) {
 
     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);