@@ -170,6 +170,9 @@ pub fn opts() -> Vec<RustcOptGroup> {
170
170
stable( "no-default" , |o| {
171
171
o. optflag( "" , "no-defaults" , "don't run the default passes" )
172
172
} ) ,
173
+ stable( "document-private-items" , |o| {
174
+ o. optflag( "" , "document-private-items" , "document private items" )
175
+ } ) ,
173
176
stable( "test" , |o| o. optflag( "" , "test" , "run code examples as tests" ) ) ,
174
177
stable( "test-args" , |o| {
175
178
o. optmulti( "" , "test-args" , "arguments to pass to the test runner" ,
@@ -461,6 +464,18 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
461
464
let mut passes = matches. opt_strs ( "passes" ) ;
462
465
let mut plugins = matches. opt_strs ( "plugins" ) ;
463
466
467
+ // We hardcode in the passes here, as this is a new flag and we
468
+ // are generally deprecating passes.
469
+ if matches. opt_present ( "document-private-items" ) {
470
+ default_passes = false ;
471
+
472
+ passes = vec ! [
473
+ String :: from( "strip-hidden" ) ,
474
+ String :: from( "collapse-docs" ) ,
475
+ String :: from( "unindent-comments" ) ,
476
+ ] ;
477
+ }
478
+
464
479
// First, parse the crate and extract all relevant information.
465
480
let mut paths = SearchPaths :: new ( ) ;
466
481
for s in & matches. opt_strs ( "L" ) {
@@ -571,4 +586,8 @@ fn check_deprecated_options(matches: &getopts::Matches) {
571
586
eprintln ! ( "WARNING: please see https://github.com/rust-lang/rust/issues/44136" ) ;
572
587
}
573
588
}
589
+
590
+ if matches. opt_present ( "no-defaults" ) {
591
+ eprintln ! ( "WARNING: (you may want to use --document-private-items)" ) ;
592
+ }
574
593
}
0 commit comments