Skip to content

Commit 29a6be5

Browse files
committed
Statically ensure that only the top_stage of a tool is documented
If another part of rustbuild tried to document a different stage, it would run into errors because `check::Rustc` unconditionally uses the top stage.
1 parent 7543293 commit 29a6be5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bootstrap/doc.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ macro_rules! tool_doc {
665665
($tool: ident, $should_run: literal, $path: literal, [$($krate: literal),+ $(,)?] $(,)?) => {
666666
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
667667
pub struct $tool {
668-
stage: u32,
669668
target: TargetSelection,
670669
}
671670

@@ -679,7 +678,7 @@ macro_rules! tool_doc {
679678
}
680679

681680
fn make_run(run: RunConfig<'_>) {
682-
run.builder.ensure($tool { stage: run.builder.top_stage, target: run.target });
681+
run.builder.ensure($tool { target: run.target });
683682
}
684683

685684
/// Generates compiler documentation.
@@ -689,7 +688,7 @@ macro_rules! tool_doc {
689688
/// we do not merge it with the other documentation from std, test and
690689
/// proc_macros. This is largely just a wrapper around `cargo doc`.
691690
fn run(self, builder: &Builder<'_>) {
692-
let stage = self.stage;
691+
let stage = builder.top_stage;
693692
let target = self.target;
694693
builder.info(
695694
&format!(

0 commit comments

Comments
 (0)