Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation warning for --passes #91717

Merged
merged 3 commits into from
Dec 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/librustdoc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,19 @@ impl Options {
return Err(0);
}

let color = config::parse_color(matches);
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
config::parse_json(matches);
let error_format = config::parse_error_format(matches, color, json_rendered);

let codegen_options = CodegenOptions::build(matches, error_format);
let debugging_opts = DebuggingOptions::build(matches, error_format);

let diag = new_handler(error_format, None, &debugging_opts);

// check for deprecated options
check_deprecated_options(matches, &diag);

if matches.opt_strs("passes") == ["list"] {
println!("Available passes for running rustdoc:");
for pass in passes::PASSES {
Expand Down Expand Up @@ -359,19 +372,6 @@ impl Options {
return Err(0);
}

let color = config::parse_color(matches);
let config::JsonConfig { json_rendered, json_unused_externs, .. } =
config::parse_json(matches);
let error_format = config::parse_error_format(matches, color, json_rendered);

let codegen_options = CodegenOptions::build(matches, error_format);
let debugging_opts = DebuggingOptions::build(matches, error_format);

let diag = new_handler(error_format, None, &debugging_opts);

// check for deprecated options
check_deprecated_options(matches, &diag);

let mut emit = Vec::new();
for list in matches.opt_strs("emit") {
for kind in list.split(',') {
Expand Down
2 changes: 2 additions & 0 deletions src/test/rustdoc-ui/issue-91713.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// check-pass
// compile-flags: --passes list
inashivb marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions src/test/rustdoc-ui/issue-91713.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
warning: the `passes` flag is deprecated
|
= note: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information

31 changes: 31 additions & 0 deletions src/test/rustdoc-ui/issue-91713.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Available passes for running rustdoc:
check_doc_test_visibility - run various visibility-related lints on doctests
strip-hidden - strips all `#[doc(hidden)]` items from the output
unindent-comments - removes excess indentation on comments in order for markdown to like it
strip-private - strips all private items from a crate which cannot be seen externally, implies strip-priv-imports
strip-priv-imports - strips all private import statements (`use`, `extern crate`) from a crate
propagate-doc-cfg - propagates `#[doc(cfg(...))]` to child items
collect-intra-doc-links - resolves intra-doc links
check-code-block-syntax - validates syntax inside Rust code blocks
collect-trait-impls - retrieves trait impls for items in the crate
calculate-doc-coverage - counts the number of items with and without documentation
check-invalid-html-tags - detects invalid HTML tags in doc comments
check-bare-urls - detects URLs that are not hyperlinks

Default passes for rustdoc:
collect-trait-impls
unindent-comments
check_doc_test_visibility
strip-hidden (when not --document-hidden-items)
strip-private (when not --document-private-items)
strip-priv-imports (when --document-private-items)
collect-intra-doc-links
check-code-block-syntax
check-invalid-html-tags
propagate-doc-cfg
check-bare-urls

Passes run with `--show-coverage`:
strip-hidden (when not --document-hidden-items)
strip-private (when not --document-private-items)
calculate-doc-coverage