Skip to content

Commit 4cd5314

Browse files
committed
Deprecate several flags in rustdoc
Part of #44136
1 parent 9a59d69 commit 4cd5314

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/librustdoc/lib.rs

+16
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ pub fn main_args(args: &[String]) -> isize {
267267
// Check for unstable options.
268268
nightly_options::check_nightly_options(&matches, &opts());
269269

270+
// check for deprecated options
271+
check_deprecated_options(&matches);
272+
270273
if matches.opt_present("h") || matches.opt_present("help") {
271274
usage("rustdoc");
272275
return 0;
@@ -538,3 +541,16 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
538541
});
539542
rx.recv().unwrap()
540543
}
544+
545+
/// Prints deprecation warnings for deprecated options
546+
fn check_deprecated_options(matches: &getopts::Matches) {
547+
if matches.opt_present("input-format") ||
548+
matches.opt_present("output-format") ||
549+
matches.opt_present("plugin-path") ||
550+
matches.opt_present("plugins") ||
551+
matches.opt_present("no-defaults") ||
552+
matches.opt_present("passes") {
553+
eprintln!("WARNING: this flag is considered deprecated");
554+
eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
555+
}
556+
}

0 commit comments

Comments
 (0)