Skip to content

Commit ce10910

Browse files
author
Collins Abitekaniza
committed
refactor, make requested changes
1 parent 42ee6d5 commit ce10910

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

src/bootstrap/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ impl Step for Rustdoc {
236236
builder.ensure(tool::CleanTools {
237237
compiler,
238238
target,
239-
mode: Mode::ToolRustc,
239+
cause: Mode::Rustc,
240240
});
241241
}
242242
}

src/bootstrap/compile.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Step for StdLink {
240240
builder.ensure(tool::CleanTools {
241241
compiler: target_compiler,
242242
target,
243-
mode: Mode::Std,
243+
cause: Mode::Std,
244244
});
245245
}
246246
}
@@ -431,7 +431,7 @@ impl Step for TestLink {
431431
builder.ensure(tool::CleanTools {
432432
compiler: target_compiler,
433433
target,
434-
mode: Mode::Test,
434+
cause: Mode::Test,
435435
});
436436
}
437437
}
@@ -585,7 +585,7 @@ impl Step for RustcLink {
585585
builder.ensure(tool::CleanTools {
586586
compiler: target_compiler,
587587
target,
588-
mode: Mode::Rustc,
588+
cause: Mode::Rustc,
589589
});
590590
}
591591
}

src/bootstrap/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,10 @@ pub enum Mode {
312312
/// Build libtest, placing output in the "stageN-test" directory.
313313
Test,
314314

315-
/// Build librustc, codegen and compiler libraries, placing output
316-
/// in the "stageN-rustc" directory.
315+
/// Build librustc, and compiler libraries, placing output in the "stageN-rustc" directory.
317316
Rustc,
317+
318+
/// Build codegen libraries, placing output in the "stageN-codegen" directory
318319
Codegen,
319320

320321
/// Build some tools, placing output in the "stageN-tools" directory.
@@ -522,12 +523,10 @@ impl Build {
522523
fn stage_out(&self, compiler: Compiler, mode: Mode) -> PathBuf {
523524
let suffix = match mode {
524525
Mode::Std => "-std",
525-
Mode::ToolStd => "-tools",
526526
Mode::Test => "-test",
527-
Mode::ToolTest => "-tools",
528527
Mode::Codegen => "-rustc",
529528
Mode::Rustc => "-rustc",
530-
Mode::ToolRustc => "-tools",
529+
Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "-tools",
531530
};
532531
self.out.join(&*compiler.host)
533532
.join(format!("stage{}{}", compiler.stage, suffix))

src/bootstrap/tool.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use toolstate::ToolState;
2828
pub struct CleanTools {
2929
pub compiler: Compiler,
3030
pub target: Interned<String>,
31-
pub mode: Mode,
31+
pub cause: Mode,
3232
}
3333

3434
impl Step for CleanTools {
@@ -41,7 +41,7 @@ impl Step for CleanTools {
4141
fn run(self, builder: &Builder) {
4242
let compiler = self.compiler;
4343
let target = self.target;
44-
let mode = self.mode;
44+
let cause = self.cause;
4545

4646
// This is for the original compiler, but if we're forced to use stage 1, then
4747
// 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 {
5353
compiler
5454
};
5555

56-
for &cur_mode in &[Mode::ToolStd, Mode::ToolTest, Mode::ToolRustc] {
56+
for &cur_mode in &[Mode::Std, Mode::Test, Mode::Rustc] {
5757
let stamp = match cur_mode {
58-
Mode::ToolStd => libstd_stamp(builder, compiler, target),
59-
Mode::ToolTest => libtest_stamp(builder, compiler, target),
60-
Mode::ToolRustc => librustc_stamp(builder, compiler, target),
58+
Mode::Std => libstd_stamp(builder, compiler, target),
59+
Mode::Test => libtest_stamp(builder, compiler, target),
60+
Mode::Rustc => librustc_stamp(builder, compiler, target),
6161
_ => panic!(),
6262
};
6363

@@ -67,7 +67,7 @@ impl Step for CleanTools {
6767

6868
// If we are a rustc tool, and std changed, we also need to clear ourselves out -- our
6969
// dependencies depend on std. Therefore, we iterate up until our own mode.
70-
if mode == cur_mode {
70+
if cause == cur_mode {
7171
break;
7272
}
7373
}

0 commit comments

Comments
 (0)