@@ -668,28 +668,27 @@ impl<'a> Builder<'a> {
668668 . map ( |entry| entry. path ( ) )
669669 }
670670
671- pub fn rustdoc ( & self , host : Interned < String > ) -> PathBuf {
672- self . ensure ( tool:: Rustdoc { host } )
671+ pub fn rustdoc ( & self , compiler : Compiler ) -> PathBuf {
672+ self . ensure ( tool:: Rustdoc { compiler } )
673673 }
674674
675- pub fn rustdoc_cmd ( & self , host : Interned < String > ) -> Command {
675+ pub fn rustdoc_cmd ( & self , compiler : Compiler ) -> Command {
676676 let mut cmd = Command :: new ( & self . out . join ( "bootstrap/debug/rustdoc" ) ) ;
677- let compiler = self . compiler ( self . top_stage , host) ;
678677 cmd. env ( "RUSTC_STAGE" , compiler. stage . to_string ( ) )
679678 . env ( "RUSTC_SYSROOT" , self . sysroot ( compiler) )
680679 // Note that this is *not* the sysroot_libdir because rustdoc must be linked
681680 // equivalently to rustc.
682681 . env ( "RUSTDOC_LIBDIR" , self . rustc_libdir ( compiler) )
683682 . env ( "CFG_RELEASE_CHANNEL" , & self . config . channel )
684- . env ( "RUSTDOC_REAL" , self . rustdoc ( host ) )
683+ . env ( "RUSTDOC_REAL" , self . rustdoc ( compiler ) )
685684 . env ( "RUSTDOC_CRATE_VERSION" , self . rust_version ( ) )
686685 . env ( "RUSTC_BOOTSTRAP" , "1" ) ;
687686
688687 // Remove make-related flags that can cause jobserver problems.
689688 cmd. env_remove ( "MAKEFLAGS" ) ;
690689 cmd. env_remove ( "MFLAGS" ) ;
691690
692- if let Some ( linker) = self . linker ( host) {
691+ if let Some ( linker) = self . linker ( compiler . host ) {
693692 cmd. env ( "RUSTC_TARGET_LINKER" , linker) ;
694693 }
695694 cmd
@@ -751,7 +750,7 @@ impl<'a> Builder<'a> {
751750 // This is the intended out directory for compiler documentation.
752751 my_out = self . compiler_doc_out ( target) ;
753752 }
754- let rustdoc = self . rustdoc ( compiler. host ) ;
753+ let rustdoc = self . rustdoc ( compiler) ;
755754 self . clear_if_dirty ( & my_out, & rustdoc) ;
756755 } else if cmd != "test" {
757756 match mode {
@@ -897,7 +896,7 @@ impl<'a> Builder<'a> {
897896 . env (
898897 "RUSTDOC_REAL" ,
899898 if cmd == "doc" || cmd == "rustdoc" || ( cmd == "test" && want_rustdoc) {
900- self . rustdoc ( compiler. host )
899+ self . rustdoc ( compiler)
901900 } else {
902901 PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" )
903902 } ,
0 commit comments