@@ -685,18 +685,7 @@ impl Step for Rustc {
685
685
target,
686
686
) ;
687
687
688
- // This uses a shared directory so that librustdoc documentation gets
689
- // correctly built and merged with the rustc documentation. This is
690
- // needed because rustdoc is built in a different directory from
691
- // rustc. rustdoc needs to be able to see everything, for example when
692
- // merging the search index, or generating local (relative) links.
693
688
let out_dir = builder. stage_out ( compiler, Mode :: Rustc ) . join ( target. triple ) . join ( "doc" ) ;
694
- t ! ( fs:: create_dir_all( out_dir. parent( ) . unwrap( ) ) ) ;
695
- symlink_dir_force ( & builder. config , & out, & out_dir) ;
696
- // Cargo puts proc macros in `target/doc` even if you pass `--target`
697
- // explicitly (https://github.com/rust-lang/cargo/issues/7677).
698
- let proc_macro_out_dir = builder. stage_out ( compiler, Mode :: Rustc ) . join ( "doc" ) ;
699
- symlink_dir_force ( & builder. config , & out, & proc_macro_out_dir) ;
700
689
701
690
// Build cargo command.
702
691
let mut cargo = builder. cargo ( compiler, Mode :: Rustc , SourceType :: InTree , target, "doc" ) ;
@@ -736,6 +725,18 @@ impl Step for Rustc {
736
725
}
737
726
}
738
727
728
+ // This uses a shared directory so that librustdoc documentation gets
729
+ // correctly built and merged with the rustc documentation.
730
+ //
731
+ // This is needed because rustdoc is built in a different directory from
732
+ // rustc. rustdoc needs to be able to see everything, for example when
733
+ // merging the search index, or generating local (relative) links.
734
+ symlink_dir_force ( & builder. config , & out, & out_dir) ;
735
+ // Cargo puts proc macros in `target/doc` even if you pass `--target`
736
+ // explicitly (https://github.com/rust-lang/cargo/issues/7677).
737
+ let proc_macro_out_dir = builder. stage_out ( compiler, Mode :: Rustc ) . join ( "doc" ) ;
738
+ symlink_dir_force ( & builder. config , & out, & proc_macro_out_dir) ;
739
+
739
740
builder. run ( & mut cargo. into ( ) ) ;
740
741
741
742
if builder. paths . iter ( ) . any ( |path| path. ends_with ( "compiler" ) ) {
0 commit comments