@@ -1595,20 +1595,10 @@ impl<'test> TestCx<'test> {
1595
1595
}
1596
1596
1597
1597
/// aux: whether we are building the aux docs or main docs
1598
- fn document ( & self , out_dir : & Path , info_json : Option < & Path > ) -> ProcRes {
1599
- /// Path to give to --include-info-json and --write-info-json
1600
- fn info_path ( cx : & TestCx < ' _ > , rel_ab : & str ) -> PathBuf {
1601
- cx. output_base_dir ( ) . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( )
1602
- . join ( "doc.parts" )
1603
- . join ( rel_ab. trim_end_matches ( ".rs" ) . replace ( "-" , "_" ) )
1604
- . join ( "crate-info.json" )
1605
- }
1606
-
1607
- let mut include_flags = Vec :: default ( ) ;
1608
-
1598
+ fn document ( & self , out_dir : & Path ) -> ProcRes {
1609
1599
if self . props . build_aux_docs {
1610
1600
for rel_ab in & self . props . aux_builds {
1611
- let aux_testpaths = self . compute_aux_test_paths ( & self . testpaths , rel_ab) ;
1601
+ let aux_testpaths = self . compute_aux_test_paths ( dbg ! ( & self . testpaths) , dbg ! ( rel_ab) ) ;
1612
1602
let aux_props =
1613
1603
self . props . from_aux_file ( & aux_testpaths. file , self . revision , self . config ) ;
1614
1604
let aux_cx = TestCx {
@@ -1617,11 +1607,14 @@ impl<'test> TestCx<'test> {
1617
1607
testpaths : & aux_testpaths,
1618
1608
revision : self . revision ,
1619
1609
} ;
1620
- let info_json = info_path ( & aux_cx, rel_ab) ;
1621
- include_flags. push ( format ! ( "--include-info-json={}" , info_json. display( ) ) ) ;
1622
1610
// Create the directory for the stdout/stderr files.
1623
1611
create_dir_all ( aux_cx. output_base_dir ( ) ) . unwrap ( ) ;
1624
- let auxres = aux_cx. document ( out_dir, Some ( & info_json) ) ;
1612
+ let out_dir = if aux_props. unique_doc_aux_dir {
1613
+ out_dir. join ( "docs" ) . join ( rel_ab. trim_end_matches ( ".rs" ) ) . join ( "doc" )
1614
+ } else {
1615
+ out_dir. to_owned ( )
1616
+ } ;
1617
+ let auxres = aux_cx. document ( & out_dir) ;
1625
1618
if !auxres. status . success ( ) {
1626
1619
return auxres;
1627
1620
}
@@ -1645,24 +1638,8 @@ impl<'test> TestCx<'test> {
1645
1638
. arg ( & self . testpaths . file )
1646
1639
. arg ( "-A" )
1647
1640
. arg ( "internal_features" )
1648
- . args ( & self . props . compile_flags ) ;
1649
-
1650
- if self . config . aux_write_doc_cci {
1651
- match info_json {
1652
- Some ( info_json) => {
1653
- rustdoc
1654
- . arg ( "-Zunstable-options" )
1655
- . arg ( "--merge=none" )
1656
- . arg ( format ! ( "--write-info-json={}" , info_json. display( ) ) ) ;
1657
- }
1658
- None => {
1659
- rustdoc
1660
- . arg ( "-Zunstable-options" )
1661
- . arg ( "--merge=write-only" )
1662
- . args ( & include_flags) ;
1663
- }
1664
- }
1665
- }
1641
+ . args ( & self . props . compile_flags )
1642
+ . args ( & self . props . doc_flags ) ;
1666
1643
1667
1644
if self . config . mode == RustdocJson {
1668
1645
rustdoc. arg ( "--output-format" ) . arg ( "json" ) . arg ( "-Zunstable-options" ) ;
@@ -1788,6 +1765,7 @@ impl<'test> TestCx<'test> {
1788
1765
fn compute_aux_test_paths ( & self , of : & TestPaths , rel_ab : & str ) -> TestPaths {
1789
1766
let test_ab =
1790
1767
of. file . parent ( ) . expect ( "test file path has no parent" ) . join ( "auxiliary" ) . join ( rel_ab) ;
1768
+ dbg ! ( & of, rel_ab, & test_ab) ;
1791
1769
if !test_ab. exists ( ) {
1792
1770
self . fatal ( & format ! ( "aux-build `{}` source not found" , test_ab. display( ) ) )
1793
1771
}
@@ -1892,7 +1870,7 @@ impl<'test> TestCx<'test> {
1892
1870
aux_dir : & Path ,
1893
1871
is_bin : bool ,
1894
1872
) -> AuxType {
1895
- let aux_testpaths = self . compute_aux_test_paths ( of , source_path) ;
1873
+ let aux_testpaths = self . compute_aux_test_paths ( dbg ! ( of ) , dbg ! ( source_path) ) ;
1896
1874
let aux_props = self . props . from_aux_file ( & aux_testpaths. file , self . revision , self . config ) ;
1897
1875
let mut aux_dir = aux_dir. to_path_buf ( ) ;
1898
1876
if is_bin {
@@ -2706,7 +2684,7 @@ impl<'test> TestCx<'test> {
2706
2684
let out_dir = self . output_base_dir ( ) ;
2707
2685
remove_and_create_dir_all ( & out_dir) ;
2708
2686
2709
- let proc_res = self . document ( & out_dir, None ) ;
2687
+ let proc_res = self . document ( & out_dir) ;
2710
2688
if !proc_res. status . success ( ) {
2711
2689
self . fatal_proc_rec ( "rustdoc failed!" , & proc_res) ;
2712
2690
}
@@ -2765,7 +2743,7 @@ impl<'test> TestCx<'test> {
2765
2743
let aux_dir = new_rustdoc. aux_output_dir ( ) ;
2766
2744
new_rustdoc. build_all_auxiliary ( & new_rustdoc. testpaths , & aux_dir, & mut rustc) ;
2767
2745
2768
- let proc_res = new_rustdoc. document ( & compare_dir, None ) ;
2746
+ let proc_res = new_rustdoc. document ( & compare_dir) ;
2769
2747
if !proc_res. status . success ( ) {
2770
2748
eprintln ! ( "failed to run nightly rustdoc" ) ;
2771
2749
return ;
@@ -2888,7 +2866,7 @@ impl<'test> TestCx<'test> {
2888
2866
let out_dir = self . output_base_dir ( ) ;
2889
2867
remove_and_create_dir_all ( & out_dir) ;
2890
2868
2891
- let proc_res = self . document ( & out_dir, None ) ;
2869
+ let proc_res = self . document ( & out_dir) ;
2892
2870
if !proc_res. status . success ( ) {
2893
2871
self . fatal_proc_rec ( "rustdoc failed!" , & proc_res) ;
2894
2872
}
@@ -3818,7 +3796,7 @@ impl<'test> TestCx<'test> {
3818
3796
if let Some ( nodejs) = & self . config . nodejs {
3819
3797
let out_dir = self . output_base_dir ( ) ;
3820
3798
3821
- self . document ( & out_dir, None ) ;
3799
+ self . document ( & out_dir) ;
3822
3800
3823
3801
let root = self . config . find_rust_src_root ( ) . unwrap ( ) ;
3824
3802
let file_stem =
0 commit comments