@@ -633,12 +633,16 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
633
633
for ( krate, path, default) in krates ( "test" ) {
634
634
rules. doc ( & krate. doc_step , path)
635
635
. dep ( |s| s. name ( "libtest-link" ) )
636
+ // Needed so rustdoc generates relative links to std.
637
+ . dep ( |s| s. name ( "doc-crate-std" ) )
636
638
. default ( default && build. config . compiler_docs )
637
639
. run ( move |s| doc:: test ( build, s. stage , s. target ) ) ;
638
640
}
639
641
for ( krate, path, default) in krates ( "rustc-main" ) {
640
642
rules. doc ( & krate. doc_step , path)
641
643
. dep ( |s| s. name ( "librustc-link" ) )
644
+ // Needed so rustdoc generates relative links to std.
645
+ . dep ( |s| s. name ( "doc-crate-std" ) )
642
646
. host ( true )
643
647
. default ( default && build. config . docs )
644
648
. run ( move |s| doc:: rustc ( build, s. stage , s. target ) ) ;
@@ -1213,31 +1217,31 @@ mod tests {
1213
1217
name : "std" . to_string ( ) ,
1214
1218
deps : Vec :: new ( ) ,
1215
1219
path : cwd. join ( "src/std" ) ,
1216
- doc_step : "doc-std" . to_string ( ) ,
1220
+ doc_step : "doc-crate- std" . to_string ( ) ,
1217
1221
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 ( ) ,
1220
1224
version : String :: new ( ) ,
1221
1225
} ) ;
1222
1226
build. crates . insert ( "test" . to_string ( ) , :: Crate {
1223
1227
name : "test" . to_string ( ) ,
1224
1228
deps : Vec :: new ( ) ,
1225
1229
path : cwd. join ( "src/test" ) ,
1226
- doc_step : "doc-test" . to_string ( ) ,
1230
+ doc_step : "doc-crate- test" . to_string ( ) ,
1227
1231
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 ( ) ,
1230
1234
version : String :: new ( ) ,
1231
1235
} ) ;
1232
1236
build. crates . insert ( "rustc-main" . to_string ( ) , :: Crate {
1233
1237
name : "rustc-main" . to_string ( ) ,
1234
1238
deps : Vec :: new ( ) ,
1235
1239
version : String :: new ( ) ,
1236
1240
path : cwd. join ( "src/rustc-main" ) ,
1237
- doc_step : "doc-rustc-main" . to_string ( ) ,
1241
+ doc_step : "doc-crate- rustc-main" . to_string ( ) ,
1238
1242
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 ( ) ,
1241
1245
} ) ;
1242
1246
return build
1243
1247
}
0 commit comments