@@ -633,12 +633,16 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
633633 for ( krate, path, default) in krates ( "test" ) {
634634 rules. doc ( & krate. doc_step , path)
635635 . dep ( |s| s. name ( "libtest-link" ) )
636+ // Needed so rustdoc generates relative links to std.
637+ . dep ( |s| s. name ( "doc-crate-std" ) )
636638 . default ( default && build. config . compiler_docs )
637639 . run ( move |s| doc:: test ( build, s. stage , s. target ) ) ;
638640 }
639641 for ( krate, path, default) in krates ( "rustc-main" ) {
640642 rules. doc ( & krate. doc_step , path)
641643 . dep ( |s| s. name ( "librustc-link" ) )
644+ // Needed so rustdoc generates relative links to std.
645+ . dep ( |s| s. name ( "doc-crate-std" ) )
642646 . host ( true )
643647 . default ( default && build. config . docs )
644648 . run ( move |s| doc:: rustc ( build, s. stage , s. target ) ) ;
@@ -1213,31 +1217,31 @@ mod tests {
12131217 name : "std" . to_string ( ) ,
12141218 deps : Vec :: new ( ) ,
12151219 path : cwd. join ( "src/std" ) ,
1216- doc_step : "doc-std" . to_string ( ) ,
1220+ doc_step : "doc-crate- std" . to_string ( ) ,
12171221 build_step : "build-crate-std" . to_string ( ) ,
1218- test_step : "test-std" . to_string ( ) ,
1219- bench_step : "bench-std" . to_string ( ) ,
1222+ test_step : "test-crate- std" . to_string ( ) ,
1223+ bench_step : "bench-crate- std" . to_string ( ) ,
12201224 version : String :: new ( ) ,
12211225 } ) ;
12221226 build. crates . insert ( "test" . to_string ( ) , :: Crate {
12231227 name : "test" . to_string ( ) ,
12241228 deps : Vec :: new ( ) ,
12251229 path : cwd. join ( "src/test" ) ,
1226- doc_step : "doc-test" . to_string ( ) ,
1230+ doc_step : "doc-crate- test" . to_string ( ) ,
12271231 build_step : "build-crate-test" . to_string ( ) ,
1228- test_step : "test-test" . to_string ( ) ,
1229- bench_step : "bench-test" . to_string ( ) ,
1232+ test_step : "test-crate- test" . to_string ( ) ,
1233+ bench_step : "bench-crate- test" . to_string ( ) ,
12301234 version : String :: new ( ) ,
12311235 } ) ;
12321236 build. crates . insert ( "rustc-main" . to_string ( ) , :: Crate {
12331237 name : "rustc-main" . to_string ( ) ,
12341238 deps : Vec :: new ( ) ,
12351239 version : String :: new ( ) ,
12361240 path : cwd. join ( "src/rustc-main" ) ,
1237- doc_step : "doc-rustc-main" . to_string ( ) ,
1241+ doc_step : "doc-crate- rustc-main" . to_string ( ) ,
12381242 build_step : "build-crate-rustc-main" . to_string ( ) ,
1239- test_step : "test-rustc-main" . to_string ( ) ,
1240- bench_step : "bench-rustc-main" . to_string ( ) ,
1243+ test_step : "test-crate- rustc-main" . to_string ( ) ,
1244+ bench_step : "bench-crate- rustc-main" . to_string ( ) ,
12411245 } ) ;
12421246 return build
12431247 }
0 commit comments