@@ -1591,7 +1591,18 @@ impl<'test> TestCx<'test> {
1591
1591
self . compose_and_run_compiler ( rustc, None )
1592
1592
}
1593
1593
1594
- fn document ( & self , out_dir : & Path ) -> ProcRes {
1594
+ /// aux: whether we are building the aux docs or main docs
1595
+ fn document ( & self , out_dir : & Path , info_json : Option < & Path > ) -> ProcRes {
1596
+ /// Path to give to --include-info-json and --write-info-json
1597
+ fn info_path ( cx : & TestCx < ' _ > , rel_ab : & str ) -> PathBuf {
1598
+ cx. output_base_dir ( ) . parent ( ) . unwrap ( ) . parent ( ) . unwrap ( )
1599
+ . join ( "doc.parts" )
1600
+ . join ( rel_ab. trim_end_matches ( ".rs" ) . replace ( "-" , "_" ) )
1601
+ . join ( "crate-info.json" )
1602
+ }
1603
+
1604
+ let mut include_flags = Vec :: default ( ) ;
1605
+
1595
1606
if self . props . build_aux_docs {
1596
1607
for rel_ab in & self . props . aux_builds {
1597
1608
let aux_testpaths = self . compute_aux_test_paths ( & self . testpaths , rel_ab) ;
@@ -1603,9 +1614,11 @@ impl<'test> TestCx<'test> {
1603
1614
testpaths : & aux_testpaths,
1604
1615
revision : self . revision ,
1605
1616
} ;
1617
+ let info_json = info_path ( & aux_cx, rel_ab) ;
1618
+ include_flags. push ( format ! ( "--include-info-json={}" , info_json. display( ) ) ) ;
1606
1619
// Create the directory for the stdout/stderr files.
1607
1620
create_dir_all ( aux_cx. output_base_dir ( ) ) . unwrap ( ) ;
1608
- let auxres = aux_cx. document ( out_dir) ;
1621
+ let auxres = aux_cx. document ( out_dir, Some ( & info_json ) ) ;
1609
1622
if !auxres. status . success ( ) {
1610
1623
return auxres;
1611
1624
}
@@ -1615,8 +1628,8 @@ impl<'test> TestCx<'test> {
1615
1628
let aux_dir = self . aux_output_dir_name ( ) ;
1616
1629
1617
1630
let rustdoc_path = self . config . rustdoc_path . as_ref ( ) . expect ( "--rustdoc-path not passed" ) ;
1618
- let mut rustdoc = Command :: new ( rustdoc_path) ;
1619
1631
1632
+ let mut rustdoc = Command :: new ( rustdoc_path) ;
1620
1633
rustdoc
1621
1634
. arg ( "-L" )
1622
1635
. arg ( self . config . run_lib_path . to_str ( ) . unwrap ( ) )
@@ -1631,6 +1644,23 @@ impl<'test> TestCx<'test> {
1631
1644
. arg ( "internal_features" )
1632
1645
. args ( & self . props . compile_flags ) ;
1633
1646
1647
+ if self . config . aux_write_doc_cci {
1648
+ match info_json {
1649
+ Some ( info_json) => {
1650
+ rustdoc
1651
+ . arg ( "-Zunstable-options" )
1652
+ . arg ( "--merge=none" )
1653
+ . arg ( format ! ( "--write-info-json={}" , info_json. display( ) ) ) ;
1654
+ }
1655
+ None => {
1656
+ rustdoc
1657
+ . arg ( "-Zunstable-options" )
1658
+ . arg ( "--merge=write-only" )
1659
+ . args ( & include_flags) ;
1660
+ }
1661
+ }
1662
+ }
1663
+
1634
1664
if self . config . mode == RustdocJson {
1635
1665
rustdoc. arg ( "--output-format" ) . arg ( "json" ) . arg ( "-Zunstable-options" ) ;
1636
1666
}
@@ -2673,7 +2703,7 @@ impl<'test> TestCx<'test> {
2673
2703
let out_dir = self . output_base_dir ( ) ;
2674
2704
remove_and_create_dir_all ( & out_dir) ;
2675
2705
2676
- let proc_res = self . document ( & out_dir) ;
2706
+ let proc_res = self . document ( & out_dir, None ) ;
2677
2707
if !proc_res. status . success ( ) {
2678
2708
self . fatal_proc_rec ( "rustdoc failed!" , & proc_res) ;
2679
2709
}
@@ -2732,7 +2762,7 @@ impl<'test> TestCx<'test> {
2732
2762
let aux_dir = new_rustdoc. aux_output_dir ( ) ;
2733
2763
new_rustdoc. build_all_auxiliary ( & new_rustdoc. testpaths , & aux_dir, & mut rustc) ;
2734
2764
2735
- let proc_res = new_rustdoc. document ( & compare_dir) ;
2765
+ let proc_res = new_rustdoc. document ( & compare_dir, None ) ;
2736
2766
if !proc_res. status . success ( ) {
2737
2767
eprintln ! ( "failed to run nightly rustdoc" ) ;
2738
2768
return ;
@@ -2855,7 +2885,7 @@ impl<'test> TestCx<'test> {
2855
2885
let out_dir = self . output_base_dir ( ) ;
2856
2886
remove_and_create_dir_all ( & out_dir) ;
2857
2887
2858
- let proc_res = self . document ( & out_dir) ;
2888
+ let proc_res = self . document ( & out_dir, None ) ;
2859
2889
if !proc_res. status . success ( ) {
2860
2890
self . fatal_proc_rec ( "rustdoc failed!" , & proc_res) ;
2861
2891
}
@@ -3697,7 +3727,7 @@ impl<'test> TestCx<'test> {
3697
3727
if let Some ( nodejs) = & self . config . nodejs {
3698
3728
let out_dir = self . output_base_dir ( ) ;
3699
3729
3700
- self . document ( & out_dir) ;
3730
+ self . document ( & out_dir, None ) ;
3701
3731
3702
3732
let root = self . config . find_rust_src_root ( ) . unwrap ( ) ;
3703
3733
let file_stem =
0 commit comments