Skip to content

Commit 4adf6ae

Browse files
committed
Deprecate several flags in rustdoc
Part of rust-lang#44136 Upgrades cargo due to rust-lang/cargo#4451
1 parent 611f375 commit 4adf6ae

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/librustdoc/lib.rs

+22
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ pub fn main_args(args: &[String]) -> isize {
275275
// Check for unstable options.
276276
nightly_options::check_nightly_options(&matches, &opts());
277277

278+
// check for deprecated options
279+
check_deprecated_options(&matches);
280+
278281
if matches.opt_present("h") || matches.opt_present("help") {
279282
usage("rustdoc");
280283
return 0;
@@ -550,3 +553,22 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
550553
});
551554
rx.recv().unwrap()
552555
}
556+
557+
/// Prints deprecation warnings for deprecated options
558+
fn check_deprecated_options(matches: &getopts::Matches) {
559+
let deprecated_flags = [
560+
"input-format",
561+
"output-format",
562+
"plugin-path",
563+
"plugins",
564+
"no-defaults",
565+
"passes",
566+
];
567+
568+
for flag in deprecated_flags.into_iter() {
569+
if matches.opt_present(flag) {
570+
eprintln!("WARNING: the '{}' flag is considered deprecated", flag);
571+
eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
572+
}
573+
}
574+
}

0 commit comments

Comments
 (0)