Skip to content

Commit

Permalink
Deprecate several flags in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
steveklabnik committed Aug 28, 2017
1 parent 9a59d69 commit 4cd5314
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ pub fn main_args(args: &[String]) -> isize {
// Check for unstable options.
nightly_options::check_nightly_options(&matches, &opts());

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

if matches.opt_present("h") || matches.opt_present("help") {
usage("rustdoc");
return 0;
Expand Down Expand Up @@ -538,3 +541,16 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
});
rx.recv().unwrap()
}

/// Prints deprecation warnings for deprecated options
fn check_deprecated_options(matches: &getopts::Matches) {
if matches.opt_present("input-format") ||
matches.opt_present("output-format") ||
matches.opt_present("plugin-path") ||
matches.opt_present("plugins") ||
matches.opt_present("no-defaults") ||
matches.opt_present("passes") {
eprintln!("WARNING: this flag is considered deprecated");
eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
}
}

0 comments on commit 4cd5314

Please sign in to comment.