Skip to content

Commit d94848a

Browse files
committed
don't let rustc-dep-of-std enable backtrace-sys
1 parent 4200442 commit d94848a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = ['crates/without_debuginfo']
2121
[dependencies]
2222
cfg-if = "0.1.10"
2323
rustc-demangle = "0.1.4"
24-
backtrace-sys = { path = "crates/backtrace-sys", version = "0.1.32", optional = true }
24+
backtrace-sys = { path = "crates/backtrace-sys", version = "0.1.32", optional = true, default_features = false }
2525
libc = { version = "0.2.45", default-features = false }
2626
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
2727
compiler_builtins = { version = '0.1.2', optional = true }
@@ -94,7 +94,7 @@ kernel32 = []
9494
# the moment, this is only possible when targetting Linux, since macOS
9595
# splits DWARF out into a separate object file. Enabling this feature
9696
# means one less C dependency.
97-
libbacktrace = ["backtrace-sys"]
97+
libbacktrace = ["backtrace-sys/backtrace-sys"]
9898
dladdr = []
9999
coresymbolication = []
100100
gimli-symbolize = ["addr2line", "findshlibs", "memmap", "goblin"]

crates/backtrace-sys/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ compiler_builtins = { version = '0.1.2', optional = true }
2020
cc = "1.0.37"
2121

2222
[features]
23+
default = ["backtrace_sys"]
24+
25+
# Without this feature, this crate does nothing.
26+
backtrace_sys = []
2327
rustc-dep-of-std = ['core', 'compiler_builtins']

crates/backtrace-sys/build.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use std::path::PathBuf;
77
fn main() {
88
let target = env::var("TARGET").unwrap();
99

10-
if target.contains("msvc") || // libbacktrace isn't used on MSVC windows
10+
if !cfg!(feature = "backtrace_sys") || // without this feature, this crate does nothing
11+
target.contains("msvc") || // libbacktrace isn't used on MSVC windows
1112
target.contains("emscripten") || // no way this will ever compile for emscripten
1213
target.contains("cloudabi") ||
1314
target.contains("hermit") ||

0 commit comments

Comments
 (0)