File tree Expand file tree Collapse file tree
src/bootstrap/src/core/builder Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -918,7 +918,10 @@ impl Builder<'_> {
918918 }
919919
920920 let rustdoc_path = match cmd_kind {
921- Kind :: Doc | Kind :: Test | Kind :: MiriTest => self . rustdoc_for_compiler ( compiler) ,
921+ Kind :: Doc => self . rustdoc_for_compiler ( compiler) ,
922+ Kind :: Test | Kind :: MiriTest if self . test_target . runs_doctests ( ) => {
923+ self . rustdoc_for_compiler ( compiler)
924+ }
922925 _ => PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" ) ,
923926 } ;
924927
Original file line number Diff line number Diff line change @@ -2423,6 +2423,19 @@ mod snapshot {
24232423 }
24242424 }
24252425
2426+ #[ test]
2427+ fn test_library_tests_only_does_not_build_rustdoc ( ) {
2428+ let ctx = TestCtx :: new ( ) ;
2429+ let host = TargetSelection :: from_user ( & host_target ( ) ) ;
2430+
2431+ let steps = ctx. config ( "test" ) . args ( & [ "--tests" , "library/core" ] ) . get_steps ( ) ;
2432+
2433+ steps. assert_contains_fuzzy ( StepMetadata :: build ( "std" , host) ) ;
2434+ steps. assert_no_match ( |metadata| {
2435+ metadata. name == "rustdoc" && metadata. kind == Kind :: Build && metadata. target == host
2436+ } ) ;
2437+ }
2438+
24262439 #[ test]
24272440 fn test_cargo_stage_1 ( ) {
24282441 let ctx = TestCtx :: new ( ) ;
You can’t perform that action at this time.
0 commit comments