Skip to content

Commit 44e03a4

Browse files
authored
Rollup merge of rust-lang#44138 - steveklabnik:rustdoc-deprecations, r=Manishearth
Deprecate several flags in rustdoc Part of rust-lang#44136 cc @rust-lang/dev-tools @rust-lang/docs This is a very basic PR to start deprecating some flags; `rustdoc` doesn't really have fancy output options like `rustc` does, so I went with `eprintln!`. Happy to change it if people feel that's not appropriate. Also, I have no idea if we can or should write tests here, so I didn't try. If someone feels strongly about it, then let's do it, but given that the only outcome here is a side effect...
2 parents efa27ac + 4cd5314 commit 44e03a4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/librustdoc/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ pub fn main_args(args: &[String]) -> isize {
267267
// Check for unstable options.
268268
nightly_options::check_nightly_options(&matches, &opts());
269269

270+
// check for deprecated options
271+
check_deprecated_options(&matches);
272+
270273
if matches.opt_present("h") || matches.opt_present("help") {
271274
usage("rustdoc");
272275
return 0;
@@ -538,3 +541,16 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
538541
});
539542
rx.recv().unwrap()
540543
}
544+
545+
/// Prints deprecation warnings for deprecated options
546+
fn check_deprecated_options(matches: &getopts::Matches) {
547+
if matches.opt_present("input-format") ||
548+
matches.opt_present("output-format") ||
549+
matches.opt_present("plugin-path") ||
550+
matches.opt_present("plugins") ||
551+
matches.opt_present("no-defaults") ||
552+
matches.opt_present("passes") {
553+
eprintln!("WARNING: this flag is considered deprecated");
554+
eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
555+
}
556+
}

0 commit comments

Comments
 (0)