about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2022-07-08 15:37:44 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2022-07-11 10:58:05 +0200
commit992346d7bd2d15bb0b1ce39b76e294c91aa70b44 (patch)
tree76c7734ed857412db6ab2ab860913711bfe22403
parenta51fb2ba827f24ec4d676a9575a0a5e46afd302a (diff)
downloadrust-992346d7bd2d15bb0b1ce39b76e294c91aa70b44.tar.gz
rust-992346d7bd2d15bb0b1ce39b76e294c91aa70b44.zip
Fix rustdoc -Zhelp and -Chelp options
-rw-r--r--src/librustdoc/config.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 272188f8299..1f30c7006f5 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -329,6 +329,17 @@ impl Options {
             return Err(0);
         }
 
+        let z_flags = matches.opt_strs("Z");
+        if z_flags.iter().any(|x| *x == "help") {
+            print_flag_list("-Z", config::DB_OPTIONS);
+            return Err(0);
+        }
+        let c_flags = matches.opt_strs("C");
+        if c_flags.iter().any(|x| *x == "help") {
+            print_flag_list("-C", config::CG_OPTIONS);
+            return Err(0);
+        }
+
         let color = config::parse_color(matches);
         let config::JsonConfig { json_rendered, json_unused_externs, .. } =
             config::parse_json(matches);
@@ -343,17 +354,6 @@ impl Options {
         // check for deprecated options
         check_deprecated_options(matches, &diag);
 
-        let z_flags = matches.opt_strs("Z");
-        if z_flags.iter().any(|x| *x == "help") {
-            print_flag_list("-Z", config::DB_OPTIONS);
-            return Err(0);
-        }
-        let c_flags = matches.opt_strs("C");
-        if c_flags.iter().any(|x| *x == "help") {
-            print_flag_list("-C", config::CG_OPTIONS);
-            return Err(0);
-        }
-
         if matches.opt_strs("passes") == ["list"] {
             println!("Available passes for running rustdoc:");
             for pass in passes::PASSES {