@@ -1729,7 +1729,7 @@ impl<'test> TestCx<'test> {
1729
1729
self . config . target . contains ( "vxworks" ) && !self . is_vxworks_pure_static ( )
1730
1730
}
1731
1731
1732
- fn compose_and_run_compiler ( & self , mut rustc : Command , input : Option < String > ) -> ProcRes {
1732
+ fn build_all_auxiliary ( & self , rustc : & mut Command ) -> PathBuf {
1733
1733
let aux_dir = self . aux_output_dir_name ( ) ;
1734
1734
1735
1735
if !self . props . aux_builds . is_empty ( ) {
@@ -1748,6 +1748,11 @@ impl<'test> TestCx<'test> {
1748
1748
rustc. arg ( "--extern" ) . arg ( format ! ( "{}={}/{}" , aux_name, aux_dir. display( ) , lib_name) ) ;
1749
1749
}
1750
1750
1751
+ aux_dir
1752
+ }
1753
+
1754
+ fn compose_and_run_compiler ( & self , mut rustc : Command , input : Option < String > ) -> ProcRes {
1755
+ let aux_dir = self . build_all_auxiliary ( & mut rustc) ;
1751
1756
self . props . unset_rustc_env . clone ( ) . iter ( ) . fold ( & mut rustc, |rustc, v| rustc. env_remove ( v) ) ;
1752
1757
rustc. envs ( self . props . rustc_env . clone ( ) ) ;
1753
1758
self . compose_and_run (
@@ -2359,13 +2364,26 @@ impl<'test> TestCx<'test> {
2359
2364
// We need to create a new struct for the lifetimes on `config` to work.
2360
2365
let new_rustdoc = TestCx {
2361
2366
config : & Config {
2362
- // FIXME: use beta or a user-specified rustdoc instead of hardcoding
2363
- // the default toolchain
2367
+ // FIXME: use beta or a user-specified rustdoc instead of
2368
+ // hardcoding the default toolchain
2364
2369
rustdoc_path : Some ( "rustdoc" . into ( ) ) ,
2370
+ // Needed for building auxiliary docs below
2371
+ rustc_path : "rustc" . into ( ) ,
2365
2372
..self . config . clone ( )
2366
2373
} ,
2367
2374
..* self
2368
2375
} ;
2376
+
2377
+ let output_file = TargetLocation :: ThisDirectory ( new_rustdoc. aux_output_dir_name ( ) ) ;
2378
+ let mut rustc = new_rustdoc. make_compile_args (
2379
+ & new_rustdoc. testpaths . file ,
2380
+ output_file,
2381
+ EmitMetadata :: No ,
2382
+ AllowUnused :: Yes ,
2383
+ ) ;
2384
+ rustc. arg ( "-L" ) . arg ( & new_rustdoc. aux_output_dir_name ( ) ) ;
2385
+ new_rustdoc. build_all_auxiliary ( & mut dbg ! ( rustc) ) ;
2386
+
2369
2387
let proc_res = new_rustdoc. document ( & compare_dir) ;
2370
2388
if !proc_res. status . success ( ) {
2371
2389
proc_res. fatal ( Some ( "failed to run nightly rustdoc" ) , || ( ) ) ;
@@ -2390,6 +2408,7 @@ impl<'test> TestCx<'test> {
2390
2408
2391
2409
let has_delta = Command :: new ( "delta" )
2392
2410
. arg ( "--version" )
2411
+ . stdout ( Stdio :: null ( ) )
2393
2412
. status ( )
2394
2413
. map_or ( false , |status| status. success ( ) ) ;
2395
2414
let mut diff = Command :: new ( "diff" ) ;
0 commit comments