@@ -463,6 +463,8 @@ macro_rules! options {
463
463
pub const parse_bool: Option <& ' static str > = None ;
464
464
pub const parse_opt_bool: Option <& ' static str > =
465
465
Some ( "one of: `y`, `yes`, `on`, `n`, `no`, or `off`" ) ;
466
+ pub const parse_all_bool: Option <& ' static str > =
467
+ Some ( "one of: `y`, `yes`, `on`, `n`, `no`, or `off`" ) ;
466
468
pub const parse_string: Option <& ' static str > = Some ( "a string" ) ;
467
469
pub const parse_opt_string: Option <& ' static str > = Some ( "a string" ) ;
468
470
pub const parse_list: Option <& ' static str > = Some ( "a space-separated list of strings" ) ;
@@ -512,6 +514,25 @@ macro_rules! options {
512
514
}
513
515
}
514
516
517
+ fn parse_all_bool( slot: & mut bool , v: Option <& str >) -> bool {
518
+ match v {
519
+ Some ( s) => {
520
+ match s {
521
+ "n" | "no" | "off" => {
522
+ * slot = false ;
523
+ }
524
+ "y" | "yes" | "on" => {
525
+ * slot = true ;
526
+ }
527
+ _ => { return false ; }
528
+ }
529
+
530
+ true
531
+ } ,
532
+ None => { * slot = true ; true }
533
+ }
534
+ }
535
+
515
536
fn parse_opt_string( slot: & mut Option <String >, v: Option <& str >) -> bool {
516
537
match v {
517
538
Some ( s) => { * slot = Some ( s. to_string( ) ) ; true } ,
@@ -756,7 +777,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
756
777
"dump MIR state at various points in translation" ) ,
757
778
dump_mir_dir: Option <String > = ( None , parse_opt_string,
758
779
"the directory the MIR is dumped into" ) ,
759
- orbit: bool = ( true , parse_bool ,
780
+ orbit: bool = ( true , parse_all_bool ,
760
781
"get MIR where it belongs - everywhere; most importantly, in orbit" ) ,
761
782
}
762
783
0 commit comments