about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsteveklabnik <steve@steveklabnik.com>2017-09-21 14:10:07 -0400
committersteveklabnik <steve@steveklabnik.com>2017-10-17 10:54:27 -0400
commitaad8787586a46fc8eb2a89260fafd8598d378b67 (patch)
tree7d4a724727da027f25a987c823ddec5cc90f9e6a
parent4adf6aed697f2d3915fdcc0ee3c5387f9d833dc5 (diff)
downloadrust-aad8787586a46fc8eb2a89260fafd8598d378b67.tar.gz
rust-aad8787586a46fc8eb2a89260fafd8598d378b67.zip
Create a new flag, --document-private-items
Fixes #44136
-rw-r--r--src/librustdoc/lib.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 90952588c55..20da99a6b13 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -170,6 +170,9 @@ pub fn opts() -> Vec<RustcOptGroup> {
         stable("no-default", |o| {
             o.optflag("", "no-defaults", "don't run the default passes")
         }),
+        stable("document-private-items", |o| {
+            o.optflag("", "document-private-items", "document private items")
+        }),
         stable("test", |o| o.optflag("", "test", "run code examples as tests")),
         stable("test-args", |o| {
             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 {
     let mut passes = matches.opt_strs("passes");
     let mut plugins = matches.opt_strs("plugins");
 
+    // We hardcode in the passes here, as this is a new flag and we
+    // are generally deprecating passes.
+    if matches.opt_present("document-private-items") {
+        default_passes = false;
+
+        passes = vec![
+            String::from("strip-hidden"),
+            String::from("collapse-docs"),
+            String::from("unindent-comments"),
+        ];
+    }
+
     // First, parse the crate and extract all relevant information.
     let mut paths = SearchPaths::new();
     for s in &matches.opt_strs("L") {
@@ -571,4 +586,8 @@ fn check_deprecated_options(matches: &getopts::Matches) {
             eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
         }
     }
+
+    if matches.opt_present("no-defaults") {
+        eprintln!("WARNING: (you may want to use --document-private-items)");
+    }
 }