1
1
use std:: env;
2
2
use std:: ffi:: { OsStr , OsString } ;
3
- use std:: path:: { Path , PathBuf } ;
3
+ use std:: path:: Path ;
4
4
5
5
use super :: { Builder , Kind } ;
6
6
use crate :: core:: build_steps:: tool:: SourceType ;
@@ -491,6 +491,8 @@ impl Builder<'_> {
491
491
build_stamp:: clear_if_dirty ( self , & out_dir, & backend) ;
492
492
}
493
493
494
+ // RUSTC AND TOOL DOWNGRADES MISMATCH
495
+ let rustdoc_path = self . rustc ( compiler) . parent ( ) . unwrap ( ) . join ( "rustdoc" ) ;
494
496
if cmd_kind == Kind :: Doc {
495
497
let my_out = match mode {
496
498
// This is the intended out directory for compiler documentation.
@@ -504,8 +506,7 @@ impl Builder<'_> {
504
506
}
505
507
_ => panic ! ( "doc mode {mode:?} not expected" ) ,
506
508
} ;
507
- let rustdoc = self . rustdoc ( compiler) ;
508
- build_stamp:: clear_if_dirty ( self , & my_out, & rustdoc) ;
509
+ build_stamp:: clear_if_dirty ( self , & my_out, & rustdoc_path) ;
509
510
}
510
511
511
512
let profile_var = |name : & str | cargo_profile_var ( name, & self . config ) ;
@@ -801,11 +802,6 @@ impl Builder<'_> {
801
802
build_stamp:: clear_if_dirty ( self , & out_dir, & self . rustc ( compiler) ) ;
802
803
}
803
804
804
- let rustdoc_path = match cmd_kind {
805
- Kind :: Doc | Kind :: Test | Kind :: MiriTest => self . rustdoc ( compiler) ,
806
- _ => PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" ) ,
807
- } ;
808
-
809
805
// Customize the compiler we're running. Specify the compiler to cargo
810
806
// as our shim and then pass it some various options used to configure
811
807
// how the actual compiler itself is called.
0 commit comments