Skip to content

Commit 992346d

Browse files
Fix rustdoc -Zhelp and -Chelp options
1 parent a51fb2b commit 992346d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/librustdoc/config.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ impl Options {
329329
return Err(0);
330330
}
331331

332+
let z_flags = matches.opt_strs("Z");
333+
if z_flags.iter().any(|x| *x == "help") {
334+
print_flag_list("-Z", config::DB_OPTIONS);
335+
return Err(0);
336+
}
337+
let c_flags = matches.opt_strs("C");
338+
if c_flags.iter().any(|x| *x == "help") {
339+
print_flag_list("-C", config::CG_OPTIONS);
340+
return Err(0);
341+
}
342+
332343
let color = config::parse_color(matches);
333344
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
334345
config::parse_json(matches);
@@ -343,17 +354,6 @@ impl Options {
343354
// check for deprecated options
344355
check_deprecated_options(matches, &diag);
345356

346-
let z_flags = matches.opt_strs("Z");
347-
if z_flags.iter().any(|x| *x == "help") {
348-
print_flag_list("-Z", config::DB_OPTIONS);
349-
return Err(0);
350-
}
351-
let c_flags = matches.opt_strs("C");
352-
if c_flags.iter().any(|x| *x == "help") {
353-
print_flag_list("-C", config::CG_OPTIONS);
354-
return Err(0);
355-
}
356-
357357
if matches.opt_strs("passes") == ["list"] {
358358
println!("Available passes for running rustdoc:");
359359
for pass in passes::PASSES {

0 commit comments

Comments
 (0)