Skip to content
/ rust Public
forked from rust-lang/rust

Commit 6203cda

Browse files
committed
reduce deps for windows-msvc targets for backtrace
1 parent aafd75a commit 6203cda

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

library/std/Cargo.toml

+5-7
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ hashbrown = { version = "0.14", default-features = false, features = ['rustc-dep
2525
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = ['rustc-dep-of-std'] }
2626

2727
# Dependencies of the `backtrace` crate
28-
addr2line = { version = "0.20.0", optional = true, default-features = false }
2928
rustc-demangle = { version = "0.1.21", features = ['rustc-dep-of-std'] }
30-
miniz_oxide = { version = "0.7.0", optional = true, default-features = false, public = false }
31-
[dependencies.object]
32-
version = "0.31.1"
33-
optional = true
34-
default-features = false
35-
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']
29+
30+
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
31+
miniz_oxide = { version = "0.7.0", optional = true, default-features = false }
32+
addr2line = { version = "0.20.0", optional = true, default-features = false }
33+
object = { version = "0.31.1", default-features = false, optional = true, features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive'] }
3634

3735
[dev-dependencies]
3836
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }

library/std/src/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,15 @@ extern crate libc;
393393
#[allow(unused_extern_crates)]
394394
extern crate unwind;
395395

396+
// FIXME: #94122 this extern crate definition only exist here to stop
397+
// miniz_oxide docs leaking into std docs. Find better way to do it.
398+
// Remove exclusion from tidy platform check when this removed.
396399
#[doc(masked)]
397400
#[allow(unused_extern_crates)]
398-
#[cfg(feature = "miniz_oxide")]
401+
#[cfg(all(
402+
not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))),
403+
feature = "miniz_oxide"
404+
))]
399405
extern crate miniz_oxide;
400406

401407
// During testing, this crate is not actually the "real" std library, but rather

0 commit comments

Comments
 (0)