Skip to content

Commit

Permalink
Deprecate several flags in rustdoc
Browse files Browse the repository at this point in the history
Part of rust-lang#44136

Upgrades cargo due to rust-lang/cargo#4451
  • Loading branch information
steveklabnik committed Oct 17, 2017
1 parent 611f375 commit 4adf6ae
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,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 @@ -550,3 +553,22 @@ 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) {
let deprecated_flags = [
"input-format",
"output-format",
"plugin-path",
"plugins",
"no-defaults",
"passes",
];

for flag in deprecated_flags.into_iter() {
if matches.opt_present(flag) {
eprintln!("WARNING: the '{}' flag is considered deprecated", flag);
eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
}
}
}

0 comments on commit 4adf6ae

Please sign in to comment.