1cargo-features = ["public-dependency"]
2
3[package]
4name = "std"
5version = "0.0.0"
6license = "MIT OR Apache-2.0"
7repository = "https://github.com/rust-lang/rust.git"
8description = "The Rust Standard Library"
9edition = "2024"
10autobenches = false
11
12[lib]
13crate-type = ["dylib", "rlib"]
14
15[dependencies]
16alloc = { path = "../alloc", public = true }
17cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
18panic_unwind = { path = "../panic_unwind", optional = true }
19panic_abort = { path = "../panic_abort" }
20core = { path = "../core", public = true }
21compiler_builtins = { version = "=0.1.152" }
22unwind = { path = "../unwind" }
23hashbrown = { version = "0.15", default-features = false, features = [
24 'rustc-dep-of-std',
25] }
26std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = [
27 'rustc-dep-of-std',
28] }
29
30# Dependencies of the `backtrace` crate
31rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'] }
32
33[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
34miniz_oxide = { version = "0.8.0", optional = true, default-features = false }
35addr2line = { version = "0.24.0", optional = true, default-features = false }
36
37[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
38libc = { version = "0.2.171", default-features = false, features = [
39 'rustc-dep-of-std',
40], public = true }
41
42[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
43object = { version = "0.36.0", default-features = false, optional = true, features = [
44 'read_core',
45 'elf',
46 'macho',
47 'pe',
48 'unaligned',
49 'archive',
50] }
51
52[target.'cfg(target_os = "aix")'.dependencies]
53object = { version = "0.36.0", default-features = false, optional = true, features = [
54 'read_core',
55 'xcoff',
56 'unaligned',
57 'archive',
58] }
59
60[target.'cfg(windows)'.dependencies.windows-targets]
61path = "../windows_targets"
62
63[dev-dependencies]
64rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
65rand_xorshift = "0.4.0"
66
67[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
68dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'] }
69
70[target.x86_64-fortanix-unknown-sgx.dependencies]
71fortanix-sgx-abi = { version = "0.5.0", features = [
72 'rustc-dep-of-std',
73], public = true }
74
75[target.'cfg(target_os = "hermit")'.dependencies]
76hermit-abi = { version = "0.5.0", features = [
77 'rustc-dep-of-std',
78], public = true }
79
80[target.'cfg(target_os = "wasi")'.dependencies]
81wasi = { version = "0.11.0", features = [
82 'rustc-dep-of-std',
83], default-features = false }
84
85[target.'cfg(target_os = "uefi")'.dependencies]
86r-efi = { version = "4.5.0", features = ['rustc-dep-of-std'] }
87r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'] }
88
89[features]
90backtrace = [
91 'addr2line/rustc-dep-of-std',
92 'object/rustc-dep-of-std',
93 'miniz_oxide/rustc-dep-of-std',
94]
95
96panic-unwind = ["panic_unwind"]
97compiler-builtins-c = ["alloc/compiler-builtins-c"]
98compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
99compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]
100compiler-builtins-no-f16-f128 = ["alloc/compiler-builtins-no-f16-f128"]
101compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"]
102llvm-libunwind = ["unwind/llvm-libunwind"]
103system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
104
105# Make panics and failed asserts immediately abort without formatting any message
106panic_immediate_abort = [
107 "core/panic_immediate_abort",
108 "alloc/panic_immediate_abort",
109]
110# Choose algorithms that are optimized for binary size instead of runtime performance
111optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"]
112
113# Make `RefCell` store additional debugging information, which is printed out when
114# a borrow error occurs
115debug_refcell = ["core/debug_refcell"]
116# Make `TypeId` store a reference to the name of the type, so that it can print that name.
117debug_typeid = ["core/debug_typeid"]
118
119
120# Enable std_detect default features for stdarch/crates/std_detect:
121# https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml
122std_detect_file_io = ["std_detect/std_detect_file_io"]
123std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
124std_detect_env_override = ["std_detect/std_detect_env_override"]
125
126# Enable using raw-dylib for Windows imports.
127# This will eventually be the default.
128windows_raw_dylib = ["windows-targets/windows_raw_dylib"]
129
130[package.metadata.fortanix-sgx]
131# Maximum possible number of threads when testing
132threads = 125
133# Maximum heap size
134heap_size = 0x8000000
135
136[[test]]
137name = "pipe-subprocess"
138path = "tests/pipe_subprocess.rs"
139harness = false
140
141[[test]]
142name = "sync"
143path = "tests/sync/lib.rs"
144
145[[test]]
146name = "floats"
147path = "tests/floats/lib.rs"
148
149[[test]]
150name = "thread_local"
151path = "tests/thread_local/lib.rs"
152
153[[bench]]
154name = "stdbenches"
155path = "benches/lib.rs"
156test = true
157
158[lints.rust.unexpected_cfgs]
159level = "warn"
160check-cfg = [
161 'cfg(bootstrap)',
162 # std use #[path] imports to portable-simd `std_float` crate
163 # and to the `backtrace` crate which messes-up with Cargo list
164 # of declared features, we therefor expect any feature cfg
165 'cfg(feature, values(any()))',
166]
167