]> git.lizzy.rs Git - rust.git/commitdiff
refactor, make requested changes
authorCollins Abitekaniza <collins.abitekaniza@osmosisworld.com>
Thu, 24 May 2018 00:20:47 +0000 (03:20 +0300)
committerCollins Abitekaniza <collins.abitekaniza@osmosisworld.com>
Sun, 3 Jun 2018 01:59:55 +0000 (04:59 +0300)
src/bootstrap/check.rs
src/bootstrap/compile.rs
src/bootstrap/lib.rs
src/bootstrap/tool.rs

index 252f3121a6b8e3da988cb8dca0f43c4770acfc60..9c8a0b046010de8fb4b62383637bc38767d86368 100644 (file)
@@ -236,7 +236,7 @@ fn run(self, builder: &Builder) {
         builder.ensure(tool::CleanTools {
             compiler,
             target,
-            mode: Mode::ToolRustc,
+            cause: Mode::Rustc,
         });
     }
 }
index 72fbbf1a5adf1635a862c0cd98eb7f766e31e346..11d9154ba696c9db0965165ce2dfc4bec5d475c8 100644 (file)
@@ -240,7 +240,7 @@ fn run(self, builder: &Builder) {
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
             target,
-            mode: Mode::Std,
+            cause: Mode::Std,
         });
     }
 }
@@ -431,7 +431,7 @@ fn run(self, builder: &Builder) {
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
             target,
-            mode: Mode::Test,
+            cause: Mode::Test,
         });
     }
 }
@@ -585,7 +585,7 @@ fn run(self, builder: &Builder) {
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
             target,
-            mode: Mode::Rustc,
+            cause: Mode::Rustc,
         });
     }
 }
index 4367fb369471bfd165240e484c39f4153bac5c94..7576505e29508a99d16ae0a3559af690f5575ace 100644 (file)
@@ -312,9 +312,10 @@ pub enum Mode {
     /// Build libtest, placing output in the "stageN-test" directory.
     Test,
 
-    /// Build librustc, codegen and compiler libraries, placing output
-    /// in the "stageN-rustc" directory.
+    /// Build librustc, and compiler libraries, placing output in the "stageN-rustc" directory.
     Rustc,
+
+    /// Build codegen libraries, placing output in the "stageN-codegen" directory
     Codegen,
 
     /// Build some tools, placing output in the "stageN-tools" directory.
@@ -522,12 +523,10 @@ fn tools_dir(&self, compiler: Compiler) -> PathBuf {
     fn stage_out(&self, compiler: Compiler, mode: Mode) -> PathBuf {
         let suffix = match mode {
             Mode::Std => "-std",
-            Mode::ToolStd => "-tools",
             Mode::Test => "-test",
-            Mode::ToolTest => "-tools",
             Mode::Codegen => "-rustc",
             Mode::Rustc => "-rustc",
-            Mode::ToolRustc => "-tools",
+            Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "-tools",
         };
         self.out.join(&*compiler.host)
                 .join(format!("stage{}{}", compiler.stage, suffix))
index f1eff1093063ad4273513097467765aaebf2fd3e..75bfa9ab39af3b0e196ec159a6b431a3933d9e9c 100644 (file)
@@ -28,7 +28,7 @@
 pub struct CleanTools {
     pub compiler: Compiler,
     pub target: Interned<String>,
-    pub mode: Mode,
+    pub cause: Mode,
 }
 
 impl Step for CleanTools {
@@ -41,7 +41,7 @@ fn should_run(run: ShouldRun) -> ShouldRun {
     fn run(self, builder: &Builder) {
         let compiler = self.compiler;
         let target = self.target;
-        let mode = self.mode;
+        let cause = self.cause;
 
         // This is for the original compiler, but if we're forced to use stage 1, then
         // std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
@@ -53,11 +53,11 @@ fn run(self, builder: &Builder) {
             compiler
         };
 
-        for &cur_mode in &[Mode::ToolStd, Mode::ToolTest, Mode::ToolRustc] {
+        for &cur_mode in &[Mode::Std, Mode::Test, Mode::Rustc] {
             let stamp = match cur_mode {
-                Mode::ToolStd => libstd_stamp(builder, compiler, target),
-                Mode::ToolTest => libtest_stamp(builder, compiler, target),
-                Mode::ToolRustc => librustc_stamp(builder, compiler, target),
+                Mode::Std => libstd_stamp(builder, compiler, target),
+                Mode::Test => libtest_stamp(builder, compiler, target),
+                Mode::Rustc => librustc_stamp(builder, compiler, target),
                 _ => panic!(),
             };
 
@@ -67,7 +67,7 @@ fn run(self, builder: &Builder) {
 
             // If we are a rustc tool, and std changed, we also need to clear ourselves out -- our
             // dependencies depend on std. Therefore, we iterate up until our own mode.
-            if mode == cur_mode {
+            if cause == cur_mode {
                 break;
             }
         }