@@ -359,11 +359,23 @@ mod defaults {
359
359
assert_eq ! ( first( cache. all:: <tool:: ErrorIndex >( ) ) , & [ tool:: ErrorIndex {
360
360
compiler: Compiler :: new( 0 , a)
361
361
} ] ) ;
362
+ assert ! ( first( cache. all:: <tool:: Rustdoc >( ) ) . is_empty( ) ) ;
363
+ }
364
+
365
+ #[ test]
366
+ fn doc_stage_1 ( ) {
367
+ let mut config = configure ( "doc" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
368
+ config. compiler_docs = true ;
369
+ config. stage = 1 ;
370
+ config. cmd = Subcommand :: Doc { open : false , json : false } ;
371
+ let mut cache = run_build ( & [ ] , config) ;
372
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
373
+
362
374
// docs should be built with the beta compiler, not with the stage0 artifacts.
363
375
// recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to,
364
376
// not the one it was built by.
365
377
assert_eq ! ( first( cache. all:: <tool:: Rustdoc >( ) ) , & [ tool:: Rustdoc {
366
- compiler: Compiler :: new( 0 , a)
378
+ compiler: Compiler :: new( 0 , a) . downgraded_from ( 1 )
367
379
} , ] ) ;
368
380
}
369
381
}
@@ -396,7 +408,7 @@ mod dist {
396
408
assert_eq ! ( first( cache. all:: <dist:: Src >( ) ) , & [ dist:: Src ] ) ;
397
409
// Make sure rustdoc is only built once.
398
410
assert_eq ! ( first( cache. all:: <tool:: Rustdoc >( ) ) , & [ tool:: Rustdoc {
399
- compiler: Compiler :: new( 1 , a) . with_stage ( 1 )
411
+ compiler: Compiler :: new( 1 , a) . downgraded_from ( 2 )
400
412
} , ] ) ;
401
413
}
402
414
@@ -764,8 +776,8 @@ mod dist {
764
776
// (currently) needed to run "cargo test" on the linkchecker, and
765
777
// should be relatively "free".
766
778
assert_eq ! ( first( builder. cache. all:: <tool:: Rustdoc >( ) ) , & [
767
- tool:: Rustdoc { compiler: Compiler :: new( 0 , a) } ,
768
- tool:: Rustdoc { compiler: Compiler :: new( 1 , a) } ,
779
+ tool:: Rustdoc { compiler: Compiler :: new( 0 , a) . downgraded_from ( 1 ) } ,
780
+ tool:: Rustdoc { compiler: Compiler :: new( 1 , a) . downgraded_from ( 2 ) } ,
769
781
] ) ;
770
782
}
771
783
}
0 commit comments