1
Fork 0

rustdoc: remove --passes and --no-defaults

- flags no longer function, see #44136
- adjust tests to match new behavior
- removed test issue-42875 (covered regression with --no-defaults)
- moved input-format to removed flags
- move all removed flags to bottom
- note flag removal in command help
- remove DefaultPassOption enum (now redundant with `show_coverage`)
This commit is contained in:
Peter Jaszkowiak 2021-12-13 23:49:29 -07:00
parent 69ac533527
commit 02b94b7922
13 changed files with 101 additions and 159 deletions

View file

@ -274,9 +274,6 @@ fn opts() -> Vec<RustcOptGroup> {
stable("h", |o| o.optflagmulti("h", "help", "show this help message")),
stable("V", |o| o.optflagmulti("V", "version", "print rustdoc's version")),
stable("v", |o| o.optflagmulti("v", "verbose", "use verbose output")),
stable("r", |o| {
o.optopt("r", "input-format", "the input type of the specified file", "[rust]")
}),
stable("w", |o| o.optopt("w", "output-format", "the output type to write", "[html]")),
stable("output", |o| {
o.optopt(
@ -313,21 +310,9 @@ fn opts() -> Vec<RustcOptGroup> {
"give precedence to `--extern-html-root-url`, not `html_root_url`",
)
}),
stable("plugin-path", |o| o.optmulti("", "plugin-path", "removed", "DIR")),
stable("C", |o| {
o.optmulti("C", "codegen", "pass a codegen option to rustc", "OPT[=VALUE]")
}),
stable("passes", |o| {
o.optmulti(
"",
"passes",
"list of passes to also run, you might want to pass it multiple times; a value of \
`list` will print available passes",
"PASSES",
)
}),
stable("plugins", |o| o.optmulti("", "plugins", "removed", "PLUGINS")),
stable("no-default", |o| o.optflagmulti("", "no-defaults", "don't run the default passes")),
stable("document-private-items", |o| {
o.optflagmulti("", "document-private-items", "document private items")
}),
@ -653,6 +638,51 @@ fn opts() -> Vec<RustcOptGroup> {
"path to function call information (for displaying examples in the documentation)",
)
}),
// deprecated / removed options
stable("plugin-path", |o| {
o.optmulti(
"",
"plugin-path",
"removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",
"DIR",
)
}),
stable("passes", |o| {
o.optmulti(
"",
"passes",
"removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",
"PASSES",
)
}),
stable("plugins", |o| {
o.optmulti(
"",
"plugins",
"removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",
"PLUGINS",
)
}),
stable("no-default", |o| {
o.optflagmulti(
"",
"no-defaults",
"removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",
)
}),
stable("r", |o| {
o.optopt(
"r",
"input-format",
"removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",
"[rust]",
)
}),
]
}
@ -761,11 +791,9 @@ fn main_options(options: config::Options) -> MainResult {
// plug/cleaning passes.
let crate_version = options.crate_version.clone();
let default_passes = options.default_passes;
let output_format = options.output_format;
// FIXME: fix this clone (especially render_options)
let externs = options.externs.clone();
let manual_passes = options.manual_passes.clone();
let render_options = options.render_options.clone();
let scrape_examples_options = options.scrape_examples_options.clone();
let config = core::create_config(options);
@ -796,8 +824,7 @@ fn main_options(options: config::Options) -> MainResult {
core::run_global_ctxt(
tcx,
resolver,
default_passes,
manual_passes,
show_coverage,
render_options,
output_format,
)