diff options
| author | steveklabnik <steve@steveklabnik.com> | 2017-08-28 19:30:45 -0400 |
|---|---|---|
| committer | steveklabnik <steve@steveklabnik.com> | 2017-10-17 10:54:27 -0400 |
| commit | 4adf6aed697f2d3915fdcc0ee3c5387f9d833dc5 (patch) | |
| tree | d432e0d69808362bb4ad7c2523a495ad990aeebe | |
| parent | 611f375a862148595d1d7c221870312e572f7d3c (diff) | |
| download | rust-4adf6aed697f2d3915fdcc0ee3c5387f9d833dc5.tar.gz rust-4adf6aed697f2d3915fdcc0ee3c5387f9d833dc5.zip | |
Deprecate several flags in rustdoc
Part of #44136 Upgrades cargo due to https://github.com/rust-lang/cargo/pull/4451
| -rw-r--r-- | src/librustdoc/lib.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 890e1169c05..90952588c55 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -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; @@ -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"); + } + } +} |
