Add -Z panic-in-drop={unwind,abort} command-line option
This commit is contained in:
parent
497ee321af
commit
c1bcf5c548
2 changed files with 15 additions and 2 deletions
|
@ -743,6 +743,7 @@ fn test_debugging_options_tracking_hash() {
|
||||||
tracked!(no_profiler_runtime, true);
|
tracked!(no_profiler_runtime, true);
|
||||||
tracked!(osx_rpath_install_name, true);
|
tracked!(osx_rpath_install_name, true);
|
||||||
tracked!(panic_abort_tests, true);
|
tracked!(panic_abort_tests, true);
|
||||||
|
tracked!(panic_in_drop, PanicStrategy::Abort);
|
||||||
tracked!(partially_uninit_const_threshold, Some(123));
|
tracked!(partially_uninit_const_threshold, Some(123));
|
||||||
tracked!(plt, Some(true));
|
tracked!(plt, Some(true));
|
||||||
tracked!(polonius, true);
|
tracked!(polonius, true);
|
||||||
|
|
|
@ -349,6 +349,7 @@ mod desc {
|
||||||
pub const parse_threads: &str = parse_number;
|
pub const parse_threads: &str = parse_number;
|
||||||
pub const parse_passes: &str = "a space-separated list of passes, or `all`";
|
pub const parse_passes: &str = "a space-separated list of passes, or `all`";
|
||||||
pub const parse_panic_strategy: &str = "either `unwind` or `abort`";
|
pub const parse_panic_strategy: &str = "either `unwind` or `abort`";
|
||||||
|
pub const parse_opt_panic_strategy: &str = parse_panic_strategy;
|
||||||
pub const parse_relro_level: &str = "one of: `full`, `partial`, or `off`";
|
pub const parse_relro_level: &str = "one of: `full`, `partial`, or `off`";
|
||||||
pub const parse_sanitizers: &str =
|
pub const parse_sanitizers: &str =
|
||||||
"comma separated list of sanitizers: `address`, `hwaddress`, `leak`, `memory` or `thread`";
|
"comma separated list of sanitizers: `address`, `hwaddress`, `leak`, `memory` or `thread`";
|
||||||
|
@ -549,7 +550,7 @@ mod parse {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
crate fn parse_panic_strategy(slot: &mut Option<PanicStrategy>, v: Option<&str>) -> bool {
|
crate fn parse_opt_panic_strategy(slot: &mut Option<PanicStrategy>, v: Option<&str>) -> bool {
|
||||||
match v {
|
match v {
|
||||||
Some("unwind") => *slot = Some(PanicStrategy::Unwind),
|
Some("unwind") => *slot = Some(PanicStrategy::Unwind),
|
||||||
Some("abort") => *slot = Some(PanicStrategy::Abort),
|
Some("abort") => *slot = Some(PanicStrategy::Abort),
|
||||||
|
@ -558,6 +559,15 @@ mod parse {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crate fn parse_panic_strategy(slot: &mut PanicStrategy, v: Option<&str>) -> bool {
|
||||||
|
match v {
|
||||||
|
Some("unwind") => *slot = PanicStrategy::Unwind,
|
||||||
|
Some("abort") => *slot = PanicStrategy::Abort,
|
||||||
|
_ => return false,
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
crate fn parse_relro_level(slot: &mut Option<RelroLevel>, v: Option<&str>) -> bool {
|
crate fn parse_relro_level(slot: &mut Option<RelroLevel>, v: Option<&str>) -> bool {
|
||||||
match v {
|
match v {
|
||||||
Some(s) => match s.parse::<RelroLevel>() {
|
Some(s) => match s.parse::<RelroLevel>() {
|
||||||
|
@ -958,7 +968,7 @@ options! {
|
||||||
"optimization level (0-3, s, or z; default: 0)"),
|
"optimization level (0-3, s, or z; default: 0)"),
|
||||||
overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
|
overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
|
||||||
"use overflow checks for integer arithmetic"),
|
"use overflow checks for integer arithmetic"),
|
||||||
panic: Option<PanicStrategy> = (None, parse_panic_strategy, [TRACKED],
|
panic: Option<PanicStrategy> = (None, parse_opt_panic_strategy, [TRACKED],
|
||||||
"panic strategy to compile crate with"),
|
"panic strategy to compile crate with"),
|
||||||
passes: Vec<String> = (Vec::new(), parse_list, [TRACKED],
|
passes: Vec<String> = (Vec::new(), parse_list, [TRACKED],
|
||||||
"a list of extra LLVM passes to run (space separated)"),
|
"a list of extra LLVM passes to run (space separated)"),
|
||||||
|
@ -1184,6 +1194,8 @@ options! {
|
||||||
"pass `-install_name @rpath/...` to the macOS linker (default: no)"),
|
"pass `-install_name @rpath/...` to the macOS linker (default: no)"),
|
||||||
panic_abort_tests: bool = (false, parse_bool, [TRACKED],
|
panic_abort_tests: bool = (false, parse_bool, [TRACKED],
|
||||||
"support compiling tests with panic=abort (default: no)"),
|
"support compiling tests with panic=abort (default: no)"),
|
||||||
|
panic_in_drop: PanicStrategy = (PanicStrategy::Unwind, parse_panic_strategy, [TRACKED],
|
||||||
|
"panic strategy for panics in drops"),
|
||||||
parse_only: bool = (false, parse_bool, [UNTRACKED],
|
parse_only: bool = (false, parse_bool, [UNTRACKED],
|
||||||
"parse only; do not compile, assemble, or link (default: no)"),
|
"parse only; do not compile, assemble, or link (default: no)"),
|
||||||
partially_uninit_const_threshold: Option<usize> = (None, parse_opt_number, [TRACKED],
|
partially_uninit_const_threshold: Option<usize> = (None, parse_opt_number, [TRACKED],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue