@@ -349,6 +349,7 @@ mod desc {
349
349
pub const parse_threads: & str = parse_number;
350
350
pub const parse_passes: & str = "a space-separated list of passes, or `all`" ;
351
351
pub const parse_panic_strategy: & str = "either `unwind` or `abort`" ;
352
+ pub const parse_opt_panic_strategy: & str = parse_panic_strategy;
352
353
pub const parse_relro_level: & str = "one of: `full`, `partial`, or `off`" ;
353
354
pub const parse_sanitizers: & str =
354
355
"comma separated list of sanitizers: `address`, `hwaddress`, `leak`, `memory` or `thread`" ;
@@ -549,7 +550,7 @@ mod parse {
549
550
}
550
551
}
551
552
552
- crate fn parse_panic_strategy ( slot : & mut Option < PanicStrategy > , v : Option < & str > ) -> bool {
553
+ crate fn parse_opt_panic_strategy ( slot : & mut Option < PanicStrategy > , v : Option < & str > ) -> bool {
553
554
match v {
554
555
Some ( "unwind" ) => * slot = Some ( PanicStrategy :: Unwind ) ,
555
556
Some ( "abort" ) => * slot = Some ( PanicStrategy :: Abort ) ,
@@ -558,6 +559,15 @@ mod parse {
558
559
true
559
560
}
560
561
562
+ crate fn parse_panic_strategy ( slot : & mut PanicStrategy , v : Option < & str > ) -> bool {
563
+ match v {
564
+ Some ( "unwind" ) => * slot = PanicStrategy :: Unwind ,
565
+ Some ( "abort" ) => * slot = PanicStrategy :: Abort ,
566
+ _ => return false ,
567
+ }
568
+ true
569
+ }
570
+
561
571
crate fn parse_relro_level ( slot : & mut Option < RelroLevel > , v : Option < & str > ) -> bool {
562
572
match v {
563
573
Some ( s) => match s. parse :: < RelroLevel > ( ) {
@@ -958,7 +968,7 @@ options! {
958
968
"optimization level (0-3, s, or z; default: 0)" ) ,
959
969
overflow_checks: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
960
970
"use overflow checks for integer arithmetic" ) ,
961
- panic: Option <PanicStrategy > = ( None , parse_panic_strategy , [ TRACKED ] ,
971
+ panic: Option <PanicStrategy > = ( None , parse_opt_panic_strategy , [ TRACKED ] ,
962
972
"panic strategy to compile crate with" ) ,
963
973
passes: Vec <String > = ( Vec :: new( ) , parse_list, [ TRACKED ] ,
964
974
"a list of extra LLVM passes to run (space separated)" ) ,
@@ -1184,6 +1194,8 @@ options! {
1184
1194
"pass `-install_name @rpath/...` to the macOS linker (default: no)" ) ,
1185
1195
panic_abort_tests: bool = ( false , parse_bool, [ TRACKED ] ,
1186
1196
"support compiling tests with panic=abort (default: no)" ) ,
1197
+ panic_in_drop: PanicStrategy = ( PanicStrategy :: Unwind , parse_panic_strategy, [ TRACKED ] ,
1198
+ "panic strategy for panics in drops" ) ,
1187
1199
parse_only: bool = ( false , parse_bool, [ UNTRACKED ] ,
1188
1200
"parse only; do not compile, assemble, or link (default: no)" ) ,
1189
1201
partially_uninit_const_threshold: Option <usize > = ( None , parse_opt_number, [ TRACKED ] ,
0 commit comments