@@ -86,8 +86,6 @@ pub struct CompileOptions {
86
86
pub target_rustc_args : Option < Vec < String > > ,
87
87
/// Crate types to be passed to rustc (single target only)
88
88
pub target_rustc_crate_types : Option < Vec < String > > ,
89
- /// Extra arguments passed to all selected targets for rustdoc.
90
- pub local_rustdoc_args : Option < Vec < String > > ,
91
89
/// Whether the `--document-private-items` flags was specified and should
92
90
/// be forwarded to `rustdoc`.
93
91
pub rustdoc_document_private_items : bool ,
@@ -110,7 +108,6 @@ impl CompileOptions {
110
108
target_rustdoc_args : None ,
111
109
target_rustc_args : None ,
112
110
target_rustc_crate_types : None ,
113
- local_rustdoc_args : None ,
114
111
rustdoc_document_private_items : false ,
115
112
honor_rust_version : true ,
116
113
} )
@@ -206,7 +203,6 @@ pub fn create_bcx<'a, 'cfg>(
206
203
ref target_rustdoc_args,
207
204
ref target_rustc_args,
208
205
ref target_rustc_crate_types,
209
- ref local_rustdoc_args,
210
206
rustdoc_document_private_items,
211
207
honor_rust_version,
212
208
} = * options;
@@ -481,32 +477,25 @@ pub fn create_bcx<'a, 'cfg>(
481
477
extra_compiler_args. insert ( units[ 0 ] . clone ( ) , args) ;
482
478
}
483
479
484
- for unit in & units {
485
- if unit. mode . is_doc ( ) || unit. mode . is_doc_test ( ) {
486
- let mut extra_args = local_rustdoc_args. clone ( ) ;
487
-
488
- // Add `--document-private-items` rustdoc flag if requested or if
489
- // the target is a binary. Binary crates get their private items
490
- // documented by default.
491
- if rustdoc_document_private_items || unit. target . is_bin ( ) {
492
- let mut args = extra_args. take ( ) . unwrap_or_default ( ) ;
493
- args. push ( "--document-private-items" . into ( ) ) ;
494
- if unit. target . is_bin ( ) {
495
- // This warning only makes sense if it's possible to document private items
496
- // sometimes and ignore them at other times. But cargo consistently passes
497
- // `--document-private-items`, so the warning isn't useful.
498
- args. push ( "-Arustdoc::private-intra-doc-links" . into ( ) ) ;
499
- }
500
- extra_args = Some ( args) ;
501
- }
502
-
503
- if let Some ( args) = extra_args {
504
- extra_compiler_args
505
- . entry ( unit. clone ( ) )
506
- . or_default ( )
507
- . extend ( args) ;
508
- }
480
+ for unit in units
481
+ . iter ( )
482
+ . filter ( |unit| unit. mode . is_doc ( ) || unit. mode . is_doc_test ( ) )
483
+ . filter ( |unit| rustdoc_document_private_items || unit. target . is_bin ( ) )
484
+ {
485
+ // Add `--document-private-items` rustdoc flag if requested or if
486
+ // the target is a binary. Binary crates get their private items
487
+ // documented by default.
488
+ let mut args = vec ! [ "--document-private-items" . into( ) ] ;
489
+ if unit. target . is_bin ( ) {
490
+ // This warning only makes sense if it's possible to document private items
491
+ // sometimes and ignore them at other times. But cargo consistently passes
492
+ // `--document-private-items`, so the warning isn't useful.
493
+ args. push ( "-Arustdoc::private-intra-doc-links" . into ( ) ) ;
509
494
}
495
+ extra_compiler_args
496
+ . entry ( unit. clone ( ) )
497
+ . or_default ( )
498
+ . extend ( args) ;
510
499
}
511
500
512
501
if honor_rust_version {
0 commit comments