From 4cd5314dd59c49a74cf1afebf9fac54ba01a8926 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Mon, 28 Aug 2017 19:30:45 -0400 Subject: [PATCH] Deprecate several flags in rustdoc Part of #44136 --- src/librustdoc/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 61a8165d26af1..0816a9facc166 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -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; @@ -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"); + } +}