@@ -696,9 +696,6 @@ impl Step for Rustc {
696
696
return ;
697
697
}
698
698
699
- // Build libstd docs so that we generate relative links.
700
- builder. ensure ( Std { stage, target } ) ;
701
-
702
699
// Build rustc.
703
700
builder. ensure ( compile:: Rustc { compiler, target } ) ;
704
701
@@ -717,12 +714,16 @@ impl Step for Rustc {
717
714
718
715
// Find dependencies for top level crates.
719
716
let mut compiler_crates = HashSet :: new ( ) ;
720
- for root_crate in & [ "rustc " , "rustc_driver " , "rustc_codegen_llvm " ] {
717
+ for root_crate in & [ "rustc_driver " , "rustc_codegen_llvm " , "rustc_codegen_ssa " ] {
721
718
let interned_root_crate = INTERNER . intern_str ( root_crate) ;
722
719
find_compiler_crates ( builder, & interned_root_crate, & mut compiler_crates) ;
723
720
}
724
721
725
722
for krate in & compiler_crates {
723
+ // Create all crate output directories first to make sure rustdoc uses
724
+ // relative links.
725
+ // FIXME: Cargo should probably do this itself.
726
+ t ! ( fs:: create_dir_all( out_dir. join( krate) ) ) ;
726
727
cargo. arg ( "-p" ) . arg ( krate) ;
727
728
}
728
729
@@ -796,8 +797,8 @@ impl Step for Rustdoc {
796
797
return ;
797
798
}
798
799
799
- // Build libstd docs so that we generate relative links.
800
- builder. ensure ( Std { stage, target } ) ;
800
+ // Build rustc docs so that we generate relative links.
801
+ builder. ensure ( Rustc { stage, target } ) ;
801
802
802
803
// Build rustdoc.
803
804
builder. ensure ( tool:: Rustdoc { host : compiler. host } ) ;
@@ -821,6 +822,10 @@ impl Step for Rustdoc {
821
822
& [ ]
822
823
) ;
823
824
825
+ // Only include compiler crates, no dependencies of those, such as `libc`.
826
+ cargo. arg ( "--no-deps" ) ;
827
+ cargo. arg ( "-p" ) . arg ( "rustdoc" ) ;
828
+
824
829
cargo. env ( "RUSTDOCFLAGS" , "--document-private-items" ) ;
825
830
builder. run ( & mut cargo) ;
826
831
}
0 commit comments