diff options
| author | Collins Abitekaniza <collins.abitekaniza@osmosisworld.com> | 2018-05-19 23:04:41 +0300 |
|---|---|---|
| committer | Collins Abitekaniza <collins.abitekaniza@osmosisworld.com> | 2018-06-03 04:59:54 +0300 |
| commit | 42ee6d5fd55574eb2778b8ddc161e5332a5635bd (patch) | |
| tree | d61ef9607a2f966a5b7e04197344d766b0d2c132 /src/bootstrap/tool.rs | |
| parent | 3515dab431702f3a926f61f52cd0743d95e4fd3f (diff) | |
| download | rust-42ee6d5fd55574eb2778b8ddc161e5332a5635bd.tar.gz rust-42ee6d5fd55574eb2778b8ddc161e5332a5635bd.zip | |
refactor Mode enum
Diffstat (limited to 'src/bootstrap/tool.rs')
| -rw-r--r-- | src/bootstrap/tool.rs | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 29f37b36e2a..f1eff109306 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -46,18 +46,18 @@ impl Step for CleanTools { // 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 // we copy the libs forward. - let tools_dir = builder.stage_out(compiler, Mode::Tool); + let tools_dir = builder.stage_out(compiler, Mode::ToolRustc); let compiler = if builder.force_use_stage1(compiler, target) { builder.compiler(1, compiler.host) } else { compiler }; - for &cur_mode in &[Mode::Libstd, Mode::Libtest, Mode::Librustc] { + for &cur_mode in &[Mode::ToolStd, Mode::ToolTest, Mode::ToolRustc] { let stamp = match cur_mode { - Mode::Libstd => libstd_stamp(builder, compiler, target), - Mode::Libtest => libtest_stamp(builder, compiler, target), - Mode::Librustc => librustc_stamp(builder, compiler, target), + Mode::ToolStd => libstd_stamp(builder, compiler, target), + Mode::ToolTest => libtest_stamp(builder, compiler, target), + Mode::ToolRustc => librustc_stamp(builder, compiler, target), _ => panic!(), }; @@ -104,10 +104,10 @@ impl Step for ToolBuild { let is_ext_tool = self.is_ext_tool; match self.mode { - Mode::Libstd => builder.ensure(compile::Std { compiler, target }), - Mode::Libtest => builder.ensure(compile::Test { compiler, target }), - Mode::Librustc => builder.ensure(compile::Rustc { compiler, target }), - Mode::Tool => panic!("unexpected Mode::Tool for tool build") + Mode::ToolStd => builder.ensure(compile::Std { compiler, target }), + Mode::ToolTest => builder.ensure(compile::Test { compiler, target }), + Mode::ToolRustc => builder.ensure(compile::Rustc { compiler, target }), + _ => panic!("unexpected Mode for tool build") } let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path); @@ -202,7 +202,7 @@ impl Step for ToolBuild { return None; } } else { - let cargo_out = builder.cargo_out(compiler, Mode::Tool, target) + let cargo_out = builder.cargo_out(compiler, Mode::ToolRustc, target) .join(exe(tool, &compiler.host)); let bin = builder.tools_dir(compiler).join(exe(tool, &compiler.host)); builder.copy(&cargo_out, &bin); @@ -218,7 +218,7 @@ pub fn prepare_tool_cargo( command: &'static str, path: &'static str, ) -> Command { - let mut cargo = builder.cargo(compiler, Mode::Tool, target, command); + let mut cargo = builder.cargo(compiler, Mode::ToolRustc, target, command); let dir = builder.src.join(path); cargo.arg("--manifest-path").arg(dir.join("Cargo.toml")); @@ -324,17 +324,17 @@ macro_rules! tool { } tool!( - Rustbook, "src/tools/rustbook", "rustbook", Mode::Librustc; - ErrorIndex, "src/tools/error_index_generator", "error_index_generator", Mode::Librustc; - UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::Libstd; - Tidy, "src/tools/tidy", "tidy", Mode::Libstd; - Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::Libstd; - CargoTest, "src/tools/cargotest", "cargotest", Mode::Libstd; - Compiletest, "src/tools/compiletest", "compiletest", Mode::Libtest; - BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Libstd; - RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::Libstd; - RustInstaller, "src/tools/rust-installer", "fabricate", Mode::Libstd; - RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::Libstd; + Rustbook, "src/tools/rustbook", "rustbook", Mode::ToolRustc; + ErrorIndex, "src/tools/error_index_generator", "error_index_generator", Mode::ToolRustc; + UnstableBookGen, "src/tools/unstable-book-gen", "unstable-book-gen", Mode::ToolStd; + Tidy, "src/tools/tidy", "tidy", Mode::ToolStd; + Linkchecker, "src/tools/linkchecker", "linkchecker", Mode::ToolStd; + CargoTest, "src/tools/cargotest", "cargotest", Mode::ToolStd; + Compiletest, "src/tools/compiletest", "compiletest", Mode::ToolTest; + BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::ToolStd; + RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::ToolStd; + RustInstaller, "src/tools/rust-installer", "fabricate", Mode::ToolStd; + RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes", Mode::ToolStd; ); #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -362,7 +362,7 @@ impl Step for RemoteTestServer { compiler: self.compiler, target: self.target, tool: "remote-test-server", - mode: Mode::Libstd, + mode: Mode::ToolStd, path: "src/tools/remote-test-server", is_ext_tool: false, extra_features: Vec::new(), @@ -430,7 +430,7 @@ impl Step for Rustdoc { // Cargo adds a number of paths to the dylib search path on windows, which results in // the wrong rustdoc being executed. To avoid the conflicting rustdocs, we name the "tool" // rustdoc a different name. - let tool_rustdoc = builder.cargo_out(build_compiler, Mode::Tool, target) + let tool_rustdoc = builder.cargo_out(build_compiler, Mode::ToolRustc, target) .join(exe("rustdoc_tool_binary", &target_compiler.host)); // don't create a stage0-sysroot/bin directory. @@ -485,7 +485,7 @@ impl Step for Cargo { compiler: self.compiler, target: self.target, tool: "cargo", - mode: Mode::Librustc, + mode: Mode::ToolRustc, path: "src/tools/cargo", is_ext_tool: false, extra_features: Vec::new(), @@ -533,7 +533,7 @@ macro_rules! tool_extended { compiler: $sel.compiler, target: $sel.target, tool: $tool_name, - mode: Mode::Librustc, + mode: Mode::ToolRustc, path: $path, extra_features: $sel.extra_features, is_ext_tool: true, @@ -587,7 +587,7 @@ impl<'a> Builder<'a> { let host = &compiler.host; let mut lib_paths: Vec<PathBuf> = vec![ PathBuf::from(&self.sysroot_libdir(compiler, compiler.host)), - self.cargo_out(compiler, Mode::Tool, *host).join("deps"), + self.cargo_out(compiler, Mode::ToolRustc, *host).join("deps"), ]; // On MSVC a tool may invoke a C compiler (e.g. compiletest in run-make |
