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,7 @@ impl Builder<'_> {
491
491
build_stamp:: clear_if_dirty ( self , & out_dir, & backend) ;
492
492
}
493
493
494
+ let rustdoc_path = self . rustc ( compiler) . parent ( ) . unwrap ( ) . join ( "rustdoc" ) ;
494
495
if cmd_kind == Kind :: Doc {
495
496
let my_out = match mode {
496
497
// This is the intended out directory for compiler documentation.
@@ -504,8 +505,7 @@ impl Builder<'_> {
504
505
}
505
506
_ => panic ! ( "doc mode {mode:?} not expected" ) ,
506
507
} ;
507
- let rustdoc = self . rustdoc ( compiler) ;
508
- build_stamp:: clear_if_dirty ( self , & my_out, & rustdoc) ;
508
+ build_stamp:: clear_if_dirty ( self , & my_out, & rustdoc_path) ;
509
509
}
510
510
511
511
let profile_var = |name : & str | cargo_profile_var ( name, & self . config ) ;
@@ -801,11 +801,6 @@ impl Builder<'_> {
801
801
build_stamp:: clear_if_dirty ( self , & out_dir, & self . rustc ( compiler) ) ;
802
802
}
803
803
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
804
// Customize the compiler we're running. Specify the compiler to cargo
810
805
// as our shim and then pass it some various options used to configure
811
806
// how the actual compiler itself is called.
0 commit comments