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 @@ -933,7 +933,10 @@ impl Builder<'_> {
933933 }
934934
935935 let rustdoc_path = match cmd_kind {
936- Kind :: Doc | Kind :: Test | Kind :: MiriTest => self . rustdoc_for_compiler ( compiler) ,
936+ Kind :: Doc => self . rustdoc_for_compiler ( compiler) ,
937+ Kind :: Test | Kind :: MiriTest if self . test_target . runs_doctests ( ) => {
938+ self . rustdoc_for_compiler ( compiler)
939+ }
937940 _ => PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" ) ,
938941 } ;
939942
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+ insta:: assert_snapshot!(
2431+ ctx. config( "test" ) . args( & [ "--tests" , "library/core" ] ) . render_steps( ) ,
2432+ @r"
2433+ [build] llvm <host>
2434+ [build] rustc 0 <host> -> rustc 1 <host>
2435+ [build] rustc 1 <host> -> std 1 <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