Skip to content

Commit 2e7176f

Browse files
authored
Auto merge of #37974 - japaric:abort, r=alexcrichton
std: make compilation of libpanic_unwind optional via a Cargo feature with this feature disabled, you can (Cargo) compile std with "panic=abort" rustbuild will build std with this feature enabled, to maintain the status quo fixes #37252 r? @alexcrichton
2 parents d9bdc63 + ba07a1b commit 2e7176f

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/bootstrap/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ impl Build {
507507
/// Get the space-separated set of activated features for the standard
508508
/// library.
509509
fn std_features(&self) -> String {
510-
let mut features = String::new();
510+
let mut features = "panic-unwind".to_string();
511511
if self.config.debug_jemalloc {
512512
features.push_str(" debug-jemalloc");
513513
}

src/libstd/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ crate-type = ["dylib", "rlib"]
1313
alloc = { path = "../liballoc" }
1414
alloc_jemalloc = { path = "../liballoc_jemalloc", optional = true }
1515
alloc_system = { path = "../liballoc_system" }
16-
panic_unwind = { path = "../libpanic_unwind" }
16+
panic_unwind = { path = "../libpanic_unwind", optional = true }
1717
panic_abort = { path = "../libpanic_abort" }
1818
collections = { path = "../libcollections" }
1919
core = { path = "../libcore" }
@@ -29,5 +29,6 @@ gcc = "0.3.27"
2929

3030
[features]
3131
backtrace = []
32-
jemalloc = ["alloc_jemalloc"]
3332
debug-jemalloc = ["alloc_jemalloc/debug"]
33+
jemalloc = ["alloc_jemalloc"]
34+
panic-unwind = ["panic_unwind"]

src/rustc/std_shim/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ core = { path = "../../libcore" }
4545

4646
# Reexport features from std
4747
[features]
48-
jemalloc = ["std/jemalloc"]
49-
debug-jemalloc = ["std/debug-jemalloc"]
5048
backtrace = ["std/backtrace"]
49+
debug-jemalloc = ["std/debug-jemalloc"]
50+
jemalloc = ["std/jemalloc"]
51+
panic-unwind = ["std/panic-unwind"]

0 commit comments

Comments
 (0)