@@ -2695,7 +2695,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) ->
2695
2695
/// which have their own separate test steps.)
2696
2696
#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
2697
2697
pub struct CrateLibrustc {
2698
- /// The compiler that will *build* rustc in test mode .
2698
+ /// The compiler that will run unit tests and doctests on the in-tree rustc source .
2699
2699
build_compiler : Compiler ,
2700
2700
target : TargetSelection ,
2701
2701
crates : Vec < String > ,
@@ -3431,24 +3431,22 @@ impl Step for LintDocs {
3431
3431
const IS_HOST : bool = true ;
3432
3432
3433
3433
fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
3434
- run. path ( "src/tools/lint-docs" )
3434
+ let stage = run. builder . top_stage ;
3435
+ // Lint docs tests might not work with stage 1, so do not run this test by default in
3436
+ // `x test` below stage 2.
3437
+ run. path ( "src/tools/lint-docs" ) . default_condition ( stage > 1 )
3435
3438
}
3436
3439
3437
3440
fn make_run ( run : RunConfig < ' _ > ) {
3438
- // Bump the stage to 2, because the rustc book requires an in-tree compiler.
3439
- // At the same time, since this step is enabled by default, we don't want `x test` to fail
3440
- // in stage 1.
3441
- let stage = if run. builder . config . is_explicit_stage ( ) || run. builder . top_stage >= 2 {
3442
- run. builder . top_stage
3443
- } else {
3444
- 2
3445
- } ;
3441
+ if run. builder . top_stage < 2 {
3442
+ eprintln ! ( "WARNING: lint-docs tests might not work below stage 2" ) ;
3443
+ }
3446
3444
3447
3445
run. builder . ensure ( LintDocs {
3448
3446
build_compiler : prepare_doc_compiler (
3449
3447
run. builder ,
3450
3448
run. builder . config . host_target ,
3451
- stage ,
3449
+ run . builder . top_stage ,
3452
3450
) ,
3453
3451
target : run. target ,
3454
3452
} ) ;
0 commit comments