File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,9 @@ pub fn main_args(args: &[String]) -> isize {
275
275
// Check for unstable options.
276
276
nightly_options:: check_nightly_options ( & matches, & opts ( ) ) ;
277
277
278
+ // check for deprecated options
279
+ check_deprecated_options ( & matches) ;
280
+
278
281
if matches. opt_present ( "h" ) || matches. opt_present ( "help" ) {
279
282
usage ( "rustdoc" ) ;
280
283
return 0 ;
@@ -550,3 +553,22 @@ where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
550
553
} ) ;
551
554
rx. recv ( ) . unwrap ( )
552
555
}
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
+ }
You can’t perform that action at this time.
0 commit comments