Skip to content

Commit ccec065

Browse files
authored
Rollup merge of rust-lang#91717 - inashivb:issue-91713, r=jyn514
Add deprecation warning for --passes Issue rust-lang#91713 mentored by `@jyn514`
2 parents 7324668 + 2b6987d commit ccec065

File tree

4 files changed

+51
-13
lines changed

4 files changed

+51
-13
lines changed

src/librustdoc/config.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,19 @@ impl Options {
327327
return Err(0);
328328
}
329329

330+
let color = config::parse_color(matches);
331+
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
332+
config::parse_json(matches);
333+
let error_format = config::parse_error_format(matches, color, json_rendered);
334+
335+
let codegen_options = CodegenOptions::build(matches, error_format);
336+
let debugging_opts = DebuggingOptions::build(matches, error_format);
337+
338+
let diag = new_handler(error_format, None, &debugging_opts);
339+
340+
// check for deprecated options
341+
check_deprecated_options(matches, &diag);
342+
330343
if matches.opt_strs("passes") == ["list"] {
331344
println!("Available passes for running rustdoc:");
332345
for pass in passes::PASSES {
@@ -359,19 +372,6 @@ impl Options {
359372
return Err(0);
360373
}
361374

362-
let color = config::parse_color(matches);
363-
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
364-
config::parse_json(matches);
365-
let error_format = config::parse_error_format(matches, color, json_rendered);
366-
367-
let codegen_options = CodegenOptions::build(matches, error_format);
368-
let debugging_opts = DebuggingOptions::build(matches, error_format);
369-
370-
let diag = new_handler(error_format, None, &debugging_opts);
371-
372-
// check for deprecated options
373-
check_deprecated_options(matches, &diag);
374-
375375
let mut emit = Vec::new();
376376
for list in matches.opt_strs("emit") {
377377
for kind in list.split(',') {

src/test/rustdoc-ui/issue-91713.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// check-pass
2+
// compile-flags: --passes list
3+
// error-pattern: the `passes` flag is deprecated
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
warning: the `passes` flag is deprecated
2+
|
3+
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information
4+
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Available passes for running rustdoc:
2+
check_doc_test_visibility - run various visibility-related lints on doctests
3+
strip-hidden - strips all `#[doc(hidden)]` items from the output
4+
unindent-comments - removes excess indentation on comments in order for markdown to like it
5+
strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports
6+
strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate
7+
propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
8+
collect-intra-doc-links - resolves intra-doc links
9+
check-code-block-syntax - validates syntax inside Rust code blocks
10+
collect-trait-impls - retrieves trait impls for items in the crate
11+
calculate-doc-coverage - counts the number of items with and without documentation
12+
check-invalid-html-tags - detects invalid HTML tags in doc comments
13+
check-bare-urls - detects URLs that are not hyperlinks
14+
15+
Default passes for rustdoc:
16+
collect-trait-impls
17+
unindent-comments
18+
check_doc_test_visibility
19+
strip-hidden (when not --document-hidden-items)
20+
strip-private (when not --document-private-items)
21+
strip-priv-imports (when --document-private-items)
22+
collect-intra-doc-links
23+
check-code-block-syntax
24+
check-invalid-html-tags
25+
propagate-doc-cfg
26+
check-bare-urls
27+
28+
Passes run with `--show-coverage`:
29+
strip-hidden (when not --document-hidden-items)
30+
strip-private (when not --document-private-items)
31+
calculate-doc-coverage

0 commit comments

Comments
 (0)