@@ -105,6 +105,14 @@ impl Display for DebuginfoLevel {
105
105
}
106
106
}
107
107
108
+ #[ derive( Clone , Copy , Debug , Default , PartialEq , Deserialize ) ]
109
+ #[ serde( rename_all = "lowercase" ) ]
110
+ pub enum PanicStrategy {
111
+ #[ default]
112
+ Unwind ,
113
+ Abort ,
114
+ }
115
+
108
116
/// LLD in bootstrap works like this:
109
117
/// - Self-contained lld: use `rust-lld` from the compiler's sysroot
110
118
/// - External: use an external `lld` binary
@@ -272,6 +280,7 @@ pub struct Config {
272
280
pub rust_profile_generate : Option < String > ,
273
281
pub rust_lto : RustcLto ,
274
282
pub rust_validate_mir_opts : Option < u32 > ,
283
+ pub rust_panic_strategy_std : PanicStrategy ,
275
284
pub llvm_profile_use : Option < String > ,
276
285
pub llvm_profile_generate : bool ,
277
286
pub llvm_libunwind_default : Option < LlvmLibunwind > ,
@@ -1111,6 +1120,7 @@ define_config! {
1111
1120
download_rustc: Option <StringOrBool > = "download-rustc" ,
1112
1121
lto: Option <String > = "lto" ,
1113
1122
validate_mir_opts: Option <u32 > = "validate-mir-opts" ,
1123
+ panic_strategy_std: Option <PanicStrategy > = "panic-strategy-std" ,
1114
1124
}
1115
1125
}
1116
1126
@@ -1562,6 +1572,7 @@ impl Config {
1562
1572
stack_protector,
1563
1573
strip,
1564
1574
lld_mode,
1575
+ panic_strategy_std,
1565
1576
} = rust;
1566
1577
1567
1578
set ( & mut config. channel , channel) ;
@@ -1594,6 +1605,7 @@ impl Config {
1594
1605
debuginfo_level_std = debuginfo_level_std_toml;
1595
1606
debuginfo_level_tools = debuginfo_level_tools_toml;
1596
1607
debuginfo_level_tests = debuginfo_level_tests_toml;
1608
+ set ( & mut config. rust_panic_strategy_std , panic_strategy_std) ;
1597
1609
1598
1610
config. rust_split_debuginfo = split_debuginfo
1599
1611
. as_deref ( )
0 commit comments