Skip to content

Commit 3f3c498

Browse files
committed
Apply review comments
1 parent e6c64df commit 3f3c498

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/bootstrap/src/core/builder/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ impl StepMetadata {
186186
pub fn get_stage(&self) -> Option<u32> {
187187
self.stage.or(self
188188
.built_by
189+
// For std, its stage corresponds to the stage of the compiler that builds it.
190+
// For everything else, a stage N things gets built by a stage N-1 compiler.
189191
.map(|compiler| if self.name == "std" { compiler.stage } else { compiler.stage + 1 }))
190192
}
191193
}

src/bootstrap/src/core/builder/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,8 +1667,7 @@ fn render_metadata(metadata: &StepMetadata) -> String {
16671667
if let Some(compiler) = metadata.built_by {
16681668
write!(record, "{} -> ", render_compiler(compiler));
16691669
}
1670-
let stage =
1671-
if let Some(stage) = metadata.get_stage() { format!("{stage} ") } else { "".to_string() };
1670+
let stage = metadata.get_stage().map(|stage| format!("{stage} ")).unwrap_or_default();
16721671
write!(record, "{} {stage}<{}>", metadata.name, normalize_target(metadata.target));
16731672
record
16741673
}

0 commit comments

Comments
 (0)