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 = { path = "../compiler-builtins/compiler-builtins" }
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.172", 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(any(windows, target_os = "cygwin"))'.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 = "5.2.0", features = ['rustc-dep-of-std'] }
87r-efi-alloc = { version = "2.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"]
124
125# Enable using raw-dylib for Windows imports.
126# This will eventually be the default.
127windows_raw_dylib = ["windows-targets/windows_raw_dylib"]
128
129[package.metadata.fortanix-sgx]
130# Maximum possible number of threads when testing
131threads = 125
132# Maximum heap size
133heap_size = 0x8000000
134
135[[test]]
136name = "pipe-subprocess"
137path = "tests/pipe_subprocess.rs"
138harness = false
139
140[[test]]
141name = "sync"
142path = "tests/sync/lib.rs"
143
144[[test]]
145name = "floats"
146path = "tests/floats/lib.rs"
147
148[[test]]
149name = "thread_local"
150path = "tests/thread_local/lib.rs"
151
152[[bench]]
153name = "stdbenches"
154path = "benches/lib.rs"
155test = true
156
157[lints.rust.unexpected_cfgs]
158level = "warn"
159check-cfg = [
160 # #[cfg(bootstrap)] loongarch32
161 'cfg(target_arch, values("loongarch32"))',
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 # Internal features aren't marked known config by default, we use these to
167 # gate tests.
168 'cfg(target_has_reliable_f16)',
169 'cfg(target_has_reliable_f16_math)',
170 'cfg(target_has_reliable_f128)',
171 'cfg(target_has_reliable_f128_math)',
172]
173
Learn Rust with the experts
Find out more