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"); + } +}