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 ;
@@ -456,7 +456,7 @@ impl Builder<'_> {
456
456
/// commands to be run with Miri.
457
457
fn cargo (
458
458
& self ,
459
- compiler : Compiler ,
459
+ mut compiler : Compiler ,
460
460
mode : Mode ,
461
461
source_type : SourceType ,
462
462
target : TargetSelection ,
@@ -473,6 +473,7 @@ impl Builder<'_> {
473
473
build_stamp:: clear_if_dirty ( self , & out_dir, & backend) ;
474
474
}
475
475
476
+ let rustdoc_path = self . rustc ( compiler) . parent ( ) . unwrap ( ) . join ( "rustdoc" ) ;
476
477
if cmd_kind == Kind :: Doc {
477
478
let my_out = match mode {
478
479
// This is the intended out directory for compiler documentation.
@@ -486,8 +487,7 @@ impl Builder<'_> {
486
487
}
487
488
_ => panic ! ( "doc mode {mode:?} not expected" ) ,
488
489
} ;
489
- let rustdoc = self . rustdoc ( compiler) ;
490
- build_stamp:: clear_if_dirty ( self , & my_out, & rustdoc) ;
490
+ build_stamp:: clear_if_dirty ( self , & my_out, & rustdoc_path) ;
491
491
}
492
492
493
493
let profile_var = |name : & str | cargo_profile_var ( name, & self . config ) ;
@@ -779,11 +779,6 @@ impl Builder<'_> {
779
779
build_stamp:: clear_if_dirty ( self , & out_dir, & self . rustc ( compiler) ) ;
780
780
}
781
781
782
- let rustdoc_path = match cmd_kind {
783
- Kind :: Doc | Kind :: Test | Kind :: MiriTest => self . rustdoc ( compiler) ,
784
- _ => PathBuf :: from ( "/path/to/nowhere/rustdoc/not/required" ) ,
785
- } ;
786
-
787
782
// Customize the compiler we're running. Specify the compiler to cargo
788
783
// as our shim and then pass it some various options used to configure
789
784
// how the actual compiler itself is called.
0 commit comments