Skip to content

Commit 4274d40

Browse files
committed
Do not run lint-docs tests in stage 1 x test by default
1 parent c57a910 commit 4274d40

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,24 +3427,22 @@ impl Step for LintDocs {
34273427
const IS_HOST: bool = true;
34283428

34293429
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
3430-
run.path("src/tools/lint-docs")
3430+
let stage = run.builder.top_stage;
3431+
// Lint docs tests might not work with stage 1, so do not run this test by default in
3432+
// `x test` below stage 2.
3433+
run.path("src/tools/lint-docs").default_condition(stage > 1)
34313434
}
34323435

34333436
fn make_run(run: RunConfig<'_>) {
3434-
// Bump the stage to 2, because the rustc book requires an in-tree compiler.
3435-
// At the same time, since this step is enabled by default, we don't want `x test` to fail
3436-
// in stage 1.
3437-
let stage = if run.builder.config.is_explicit_stage() || run.builder.top_stage >= 2 {
3438-
run.builder.top_stage
3439-
} else {
3440-
2
3441-
};
3437+
if run.builder.top_stage < 2 {
3438+
eprintln!("WARNING: lint-docs tests might not work below stage 2");
3439+
}
34423440

34433441
run.builder.ensure(LintDocs {
34443442
build_compiler: prepare_doc_compiler(
34453443
run.builder,
34463444
run.builder.config.host_target,
3447-
stage,
3445+
run.builder.top_stage,
34483446
),
34493447
target: run.target,
34503448
});

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,8 +1980,6 @@ mod snapshot {
19801980
[test] link-check <host>
19811981
[test] tier-check <host>
19821982
[test] rustc 0 <host> -> rust-analyzer 1 <host>
1983-
[doc] rustc (book) <host>
1984-
[test] rustc 1 <host> -> lint-docs 2 <host>
19851983
[build] rustc 0 <host> -> RustdocTheme 1 <host>
19861984
[test] rustdoc-theme 1 <host>
19871985
[test] RustdocUi <host>

0 commit comments

Comments
 (0)