@@ -416,12 +416,26 @@ impl VerificationArgs {
416416 }
417417 }
418418
419- /// Given an argument, warn if UnstableFeature::UnstableOptions is enabled.
419+ /// Given the string representation of an option, warn if it's enabled while
420+ /// UnstableFeature::UnstableOptions is also enabled.
420421 /// This is for cases where the option was previously unstable but has since been stabilized.
422+ /// Example invocation: self.check_unnecessary_unstable_option(self.jobs.is_some(), "jobs");
423+ #[ allow( dead_code) ]
421424 pub fn check_unnecessary_unstable_option ( & self , enabled : bool , option : & str ) {
425+ // Note that the body of this function is subject to change; an option
426+ // will only be here if it has been stabilized *recently*, such that we should still warn about unstable-options.
427+ // So a body of just `None` is fine, since that just means that no unstable options are currently in that in-between period.
428+ // Example of an appropriate body:
429+ // ```rust
430+ // match option {
431+ // "jobs" => Some("0.63.0".to_string()),
432+ // _ => None,
433+ // }
434+ // ```
435+ // for the unstable jobs option, which was stabilized in version 0.63.
436+ #[ allow( clippy:: match_single_binding) ]
422437 fn stabilization_version ( option : & str ) -> Option < String > {
423438 match option {
424- "jobs" => Some ( "0.63.0" . to_string ( ) ) ,
425439 _ => None ,
426440 }
427441 }
@@ -473,81 +487,39 @@ pub enum OutputFormat {
473487#[ derive( Debug , clap:: Args ) ]
474488#[ clap( next_help_heading = "Memory Checks" ) ]
475489pub struct CheckArgs {
476- // Rust argument parsers (/clap) don't have the convenient '--flag' and '--no-flag' boolean pairs, so approximate
477- // We're put both here then create helper functions to "intepret"
478- /// Turn on all default checks
479- #[ arg( long, hide = true ) ]
480- pub default_checks : bool ,
481490 /// Turn off all default checks
482491 #[ arg( long) ]
483492 pub no_default_checks : bool ,
484493
485- /// Turn on default memory safety checks
486- #[ arg( long, hide = true ) ]
487- pub memory_safety_checks : bool ,
488494 /// Turn off default memory safety checks
489495 #[ arg( long) ]
490496 pub no_memory_safety_checks : bool ,
491497
492- /// Turn on default overflow checks
493- #[ arg( long, hide = true ) ]
494- pub overflow_checks : bool ,
495498 /// Turn off default overflow checks
496499 #[ arg( long) ]
497500 pub no_overflow_checks : bool ,
498501
499- /// Turn on undefined function checks
500- #[ arg( long, hide = true ) ]
501- pub undefined_function_checks : bool ,
502502 /// Turn off undefined function checks
503503 #[ arg( long) ]
504504 pub no_undefined_function_checks : bool ,
505505
506- /// Turn on default unwinding checks
507- #[ arg( long, hide = true ) ]
508- pub unwinding_checks : bool ,
509506 /// Turn off default unwinding checks
510507 #[ arg( long) ]
511508 pub no_unwinding_checks : bool ,
512509}
513510
514511impl CheckArgs {
515512 pub fn memory_safety_on ( & self ) -> bool {
516- !self . no_default_checks && !self . no_memory_safety_checks || self . memory_safety_checks
513+ !self . no_default_checks && !self . no_memory_safety_checks
517514 }
518515 pub fn overflow_on ( & self ) -> bool {
519- !self . no_default_checks && !self . no_overflow_checks || self . overflow_checks
516+ !self . no_default_checks && !self . no_overflow_checks
520517 }
521518 pub fn undefined_function_on ( & self ) -> bool {
522519 !self . no_default_checks && !self . no_undefined_function_checks
523- || self . undefined_function_checks
524520 }
525521 pub fn unwinding_on ( & self ) -> bool {
526- !self . no_default_checks && !self . no_unwinding_checks || self . unwinding_checks
527- }
528- pub fn print_deprecated ( & self , verbosity : & CommonArgs ) {
529- let deprecation_version = "0.63.0" ;
530- let alternative = "omitting the argument, since this is already the default behavior" ;
531- if self . default_checks {
532- print_deprecated ( verbosity, "--default-checks" , deprecation_version, alternative) ;
533- }
534- if self . memory_safety_checks {
535- print_deprecated ( verbosity, "--memory-safety-checks" , deprecation_version, alternative) ;
536- }
537- if self . overflow_checks {
538- print_deprecated ( verbosity, "--overflow-checks" , deprecation_version, alternative) ;
539- }
540- if self . undefined_function_checks {
541- print_deprecated (
542- verbosity,
543- "--undefined-function-checks" ,
544- deprecation_version,
545- alternative,
546- ) ;
547- }
548- if self . unwinding_checks {
549- print_deprecated ( verbosity, "--unwinding-checks" , deprecation_version, alternative) ;
550- }
522+ !self . no_default_checks && !self . no_unwinding_checks
551523 }
552524}
553525
@@ -807,9 +779,6 @@ impl ValidateArgs for VerificationArgs {
807779
808780 // Check for any deprecated/obsolete options, or providing an unstable flag that has since been stabilized.
809781 let deprecated_stabilized_obsolete = || -> Result < ( ) , Error > {
810- self . checks . print_deprecated ( & self . common_args ) ;
811- self . check_unnecessary_unstable_option ( self . jobs . is_some ( ) , "jobs" ) ;
812-
813782 if self . write_json_symtab {
814783 return Err ( Error :: raw (
815784 ErrorKind :: ValueValidation ,
0 commit comments