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 }
17# std no longer uses cfg-if directly, but the included copy of backtrace does.
18cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
19panic_unwind = { path = "../panic_unwind", optional = true }
20panic_abort = { path = "../panic_abort" }
21core = { path = "../core", public = true }
22unwind = { path = "../unwind" }
23hashbrown = { version = "0.16.1", default-features = false, features = [
24 'rustc-dep-of-std',
25] }
26std_detect = { path = "../std_detect", public = true }
27
28# Dependencies of the `backtrace` crate
29rustc-demangle = { version = "0.1.27", features = ['rustc-dep-of-std'] }
30
31[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
32miniz_oxide = { version = "0.8.0", optional = true, default-features = false }
33addr2line = { version = "0.25.0", optional = true, default-features = false }
34
35[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
36libc = { version = "0.2.178", default-features = false, features = [
37 'rustc-dep-of-std',
38], public = true }
39
40[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
41object = { version = "0.37.1", default-features = false, optional = true, features = [
42 'read_core',
43 'elf',
44 'macho',
45 'pe',
46 'unaligned',
47 'archive',
48] }
49
50[target.'cfg(target_os = "aix")'.dependencies]
51object = { version = "0.37.1", default-features = false, optional = true, features = [
52 'read_core',
53 'xcoff',
54 'unaligned',
55 'archive',
56] }
57
58[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies.windows-link]
59path = "../windows_link"
60
61[dev-dependencies]
62rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
63rand_xorshift = "0.4.0"
64
65[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", target_os = "vexos", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
66dlmalloc = { version = "0.2.10", features = ['rustc-dep-of-std'] }
67
68[target.x86_64-fortanix-unknown-sgx.dependencies]
69fortanix-sgx-abi = { version = "0.6.1", features = [
70 'rustc-dep-of-std',
71], public = true }
72
73[target.'cfg(target_os = "motor")'.dependencies]
74moto-rt = { version = "0.16", features = ['rustc-dep-of-std'], public = true }
75
76[target.'cfg(target_os = "hermit")'.dependencies]
77hermit-abi = { version = "0.5.0", features = [
78 'rustc-dep-of-std',
79], public = true }
80
81[target.'cfg(all(target_os = "wasi", target_env = "p1"))'.dependencies]
82wasi = { version = "0.11.0", features = [
83 'rustc-dep-of-std',
84], default-features = false }
85
86[target.'cfg(all(target_os = "wasi", target_env = "p2"))'.dependencies]
87wasip2 = { version = '0.14.4', features = [
88 'rustc-dep-of-std',
89], default-features = false, package = 'wasi' }
90
91[target.'cfg(all(target_os = "wasi", target_env = "p3"))'.dependencies]
92wasip2 = { version = '0.14.4', features = [
93 'rustc-dep-of-std',
94], default-features = false, package = 'wasi' }
95
96[target.'cfg(target_os = "uefi")'.dependencies]
97r-efi = { version = "5.2.0", features = ['rustc-dep-of-std'] }
98r-efi-alloc = { version = "2.0.0", features = ['rustc-dep-of-std'] }
99
100[target.'cfg(target_os = "vexos")'.dependencies]
101vex-sdk = { version = "0.27.0", features = [
102 'rustc-dep-of-std',
103], default-features = false }
104
105[features]
106backtrace = [
107 'addr2line/rustc-dep-of-std',
108 'object/rustc-dep-of-std',
109 'miniz_oxide/rustc-dep-of-std',
110]
111# Disable symbolization in backtraces. For use with -Zbuild-std.
112# FIXME: Ideally this should be an additive backtrace-symbolization feature
113backtrace-trace-only = []
114
115panic-unwind = ["dep:panic_unwind"]
116compiler-builtins-c = ["alloc/compiler-builtins-c"]
117compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
118llvm-libunwind = ["unwind/llvm-libunwind"]
119system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
120
121# Choose algorithms that are optimized for binary size instead of runtime performance
122optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"]
123
124# Make `RefCell` store additional debugging information, which is printed out when
125# a borrow error occurs
126debug_refcell = ["core/debug_refcell"]
127
128llvm_enzyme = ["core/llvm_enzyme"]
129
130# Enable using raw-dylib for Windows imports.
131# This will eventually be the default.
132windows_raw_dylib = ["windows-link/windows_raw_dylib"]
133
134[package.metadata.fortanix-sgx]
135# Maximum possible number of threads when testing
136threads = 125
137# Maximum heap size
138heap_size = 0x8000000
139
140[[test]]
141name = "pipe-subprocess"
142path = "tests/pipe_subprocess.rs"
143harness = false
144
145[[test]]
146name = "sync"
147path = "tests/sync/lib.rs"
148
149[[test]]
150name = "floats"
151path = "tests/floats/lib.rs"
152
153[[test]]
154name = "thread_local"
155path = "tests/thread_local/lib.rs"
156
157[[bench]]
158name = "stdbenches"
159path = "benches/lib.rs"
160test = true
161
162[lints.rust.unexpected_cfgs]
163level = "warn"
164check-cfg = [
165 # std use #[path] imports to portable-simd `std_float` crate
166 # and to the `backtrace` crate which messes-up with Cargo list
167 # of declared features, we therefor expect any feature cfg
168 'cfg(feature, values(any()))',
169 # Internal features aren't marked known config by default, we use these to
170 # gate tests.
171 'cfg(target_has_reliable_f16)',
172 'cfg(target_has_reliable_f16_math)',
173 'cfg(target_has_reliable_f128)',
174 'cfg(target_has_reliable_f128_math)',
175]
176