about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorCollins Abitekaniza <collins.abitekaniza@osmosisworld.com>2018-05-24 03:20:47 +0300
committerCollins Abitekaniza <collins.abitekaniza@osmosisworld.com>2018-06-03 04:59:55 +0300
commitce10910b69c7c2c90a9ba2aeb7c498cb2cfd3ac9 (patch)
tree7e07bba273bb9a57ee96517465f691c3a6290706 /src/bootstrap
parent42ee6d5fd55574eb2778b8ddc161e5332a5635bd (diff)
downloadrust-ce10910b69c7c2c90a9ba2aeb7c498cb2cfd3ac9.tar.gz
rust-ce10910b69c7c2c90a9ba2aeb7c498cb2cfd3ac9.zip
refactor, make requested changes
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/check.rs2
-rw-r--r--src/bootstrap/compile.rs6
-rw-r--r--src/bootstrap/lib.rs9
-rw-r--r--src/bootstrap/tool.rs14
4 files changed, 15 insertions, 16 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 252f3121a6b..9c8a0b04601 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -236,7 +236,7 @@ impl Step for Rustdoc {
         builder.ensure(tool::CleanTools {
             compiler,
             target,
-            mode: Mode::ToolRustc,
+            cause: Mode::Rustc,
         });
     }
 }
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 72fbbf1a5ad..11d9154ba69 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -240,7 +240,7 @@ impl Step for StdLink {
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
             target,
-            mode: Mode::Std,
+            cause: Mode::Std,
         });
     }
 }
@@ -431,7 +431,7 @@ impl Step for TestLink {
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
             target,
-            mode: Mode::Test,
+            cause: Mode::Test,
         });
     }
 }
@@ -585,7 +585,7 @@ impl Step for RustcLink {
         builder.ensure(tool::CleanTools {
             compiler: target_compiler,
             target,
-            mode: Mode::Rustc,
+            cause: Mode::Rustc,
         });
     }
 }
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 4367fb36947..7576505e295 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -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 @@ impl Build {
     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))
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs
index f1eff109306..75bfa9ab39a 100644
--- a/src/bootstrap/tool.rs
+++ b/src/bootstrap/tool.rs
@@ -28,7 +28,7 @@ use toolstate::ToolState;
 pub struct CleanTools {
     pub compiler: Compiler,
     pub target: Interned<String>,
-    pub mode: Mode,
+    pub cause: Mode,
 }
 
 impl Step for CleanTools {
@@ -41,7 +41,7 @@ impl Step for CleanTools {
     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 @@ impl Step for CleanTools {
             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 @@ impl Step for CleanTools {
 
             // 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;
             }
         }