File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -505,6 +505,8 @@ binaries, and as such worth documenting:
505
505
* `MIRI_LOCAL_CRATES` is set by `cargo-miri` to tell the Miri driver which
506
506
crates should be given special treatment in diagnostics, in addition to the
507
507
crate currently being compiled.
508
+ * `MIRI_ORIG_RUSTDOC` is set and read by different phases of `cargo-miri` to remember the
509
+ value of `RUSTDOC` from before it was overwritten.
508
510
* `MIRI_VERBOSE` when set to any value tells the various `cargo-miri` phases to
509
511
perform verbose logging.
510
512
* `MIRI_HOST_SYSROOT` is set by bootstrap to tell `cargo-miri` which sysroot to use for *host*
Original file line number Diff line number Diff line change @@ -202,6 +202,9 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
202
202
cmd. env ( "MIRI_BE_RUSTC" , "target" ) ; // we better remember to *unset* this in the other phases!
203
203
204
204
// Set rustdoc to us as well, so we can run doctests.
205
+ if let Some ( orig_rustdoc) = env:: var_os ( "RUSTDOC" ) {
206
+ cmd. env ( "MIRI_ORIG_RUSTDOC" , orig_rustdoc) ;
207
+ }
205
208
cmd. env ( "RUSTDOC" , & cargo_miri_path) ;
206
209
207
210
cmd. env ( "MIRI_LOCAL_CRATES" , local_crates ( & metadata) ) ;
@@ -581,9 +584,10 @@ pub fn phase_rustdoc(mut args: impl Iterator<Item = String>) {
581
584
let verbose = std:: env:: var ( "MIRI_VERBOSE" )
582
585
. map_or ( 0 , |verbose| verbose. parse ( ) . expect ( "verbosity flag must be an integer" ) ) ;
583
586
584
- // phase_cargo_miri sets the RUSTDOC env var to ourselves, so we can't use that here;
585
- // just default to a straight-forward invocation for now:
586
- let mut cmd = Command :: new ( "rustdoc" ) ;
587
+ // phase_cargo_miri sets the RUSTDOC env var to ourselves, and puts a backup
588
+ // of the old value into MIRI_ORIG_RUSTDOC. So that's what we have to invoke now.
589
+ let rustdoc = env:: var ( "MIRI_ORIG_RUSTDOC" ) . unwrap_or ( "rustdoc" . to_string ( ) ) ;
590
+ let mut cmd = Command :: new ( rustdoc) ;
587
591
588
592
let extern_flag = "--extern" ;
589
593
let runtool_flag = "--runtool" ;
You can’t perform that action at this time.
0 commit comments