@@ -359,11 +359,23 @@ mod defaults {
359359 assert_eq ! ( first( cache. all:: <tool:: ErrorIndex >( ) ) , & [ tool:: ErrorIndex {
360360 compiler: Compiler :: new( 0 , a)
361361 } ] ) ;
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+
362374 // docs should be built with the beta compiler, not with the stage0 artifacts.
363375 // recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to,
364376 // not the one it was built by.
365377 assert_eq ! ( first( cache. all:: <tool:: Rustdoc >( ) ) , & [ tool:: Rustdoc {
366- compiler: Compiler :: new( 0 , a)
378+ compiler: Compiler :: new( 0 , a) . downgraded_from ( 1 )
367379 } , ] ) ;
368380 }
369381}
@@ -396,7 +408,7 @@ mod dist {
396408 assert_eq ! ( first( cache. all:: <dist:: Src >( ) ) , & [ dist:: Src ] ) ;
397409 // Make sure rustdoc is only built once.
398410 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 )
400412 } , ] ) ;
401413 }
402414
@@ -764,8 +776,8 @@ mod dist {
764776 // (currently) needed to run "cargo test" on the linkchecker, and
765777 // should be relatively "free".
766778 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 ) } ,
769781 ] ) ;
770782 }
771783}
0 commit comments