@@ -18,31 +18,68 @@ cfg-if = "1"
1818compiler_builtins = { version = " 0.1" , optional = true }
1919core = { version = " 1.0" , optional = true , package = " rustc-std-workspace-core" }
2020
21- [target .'cfg(unix)' .dependencies ]
21+ # linux_android / linux_android_with_fallback
22+ [target .'cfg(all(any(target_os = "linux", target_os = "android"), not(any(target_env = "", getrandom_backend = "linux_rustix", getrandom_backend = "custom"))))' .dependencies ]
2223libc = { version = " 0.2.154" , default-features = false }
2324
25+ # linux_rustix
26+ [target .'cfg(all(any(target_os = "linux", target_os = "android"), any(target_env = "", getrandom_backend = "linux_rustix")))' .dependencies ]
27+ rustix = { version = " 0.38" , default-features = false , features = [" rand" ] }
28+
29+ # apple-other
30+ [target .'cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos"))' .dependencies ]
31+ libc = { version = " 0.2.154" , default-features = false }
32+
33+ # getentropy
34+ [target .'cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten"))' .dependencies ]
35+ libc = { version = " 0.2.154" , default-features = false }
36+
37+ # getrandom
38+ [target .'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm")))' .dependencies ]
39+ libc = { version = " 0.2.154" , default-features = false }
40+
41+ # netbsd
42+ [target .'cfg(target_os = "netbsd")' .dependencies ]
43+ libc = { version = " 0.2.154" , default-features = false }
44+
45+ # solaris
46+ [target .'cfg(target_os = "solaris")' .dependencies ]
47+ libc = { version = " 0.2.154" , default-features = false }
48+
49+ # use_file
50+ [target .'cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix"))' .dependencies ]
51+ libc = { version = " 0.2.154" , default-features = false }
52+
53+ # vxworks
54+ [target .'cfg(target_os = "vxworks")' .dependencies ]
55+ libc = { version = " 0.2.154" , default-features = false }
56+
57+ # wasi (0.2 only)
2458[target .'cfg(all(target_arch = "wasm32", target_os = "wasi", target_env = "p2"))' .dependencies ]
2559wasi = { version = " 0.13" , default-features = false }
2660
61+ # windows7
2762[target .'cfg(all(windows, not(target_vendor = "win7")))' .dependencies ]
2863windows-targets = " 0.52"
2964
65+ # wasm_js
3066[target .'cfg(all(getrandom_backend = "wasm_js", any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))' .dependencies ]
3167wasm-bindgen = { version = " 0.2.89" , default-features = false }
3268js-sys = " 0.3"
33- [target .'cfg(all(getrandom_backend = "wasm_js", getrandom_browser_test, any( target_arch = "wasm32", target_arch = "wasm64") , target_os = "unknown"))' .dev-dependencies ]
69+ [target .'cfg(all(getrandom_backend = "wasm_js", getrandom_browser_test, target_arch = "wasm32", target_os = "unknown"))' .dev-dependencies ]
3470wasm-bindgen-test = " 0.3.39"
3571
3672[features ]
37- # Implement std-only traits for getrandom::Error
73+ # Implement std::error::Error for getrandom::Error and
74+ # use std to retrieve OS error descriptions
3875std = []
3976# Unstable feature to support being a libstd dependency
4077rustc-dep-of-std = [" compiler_builtins" , " core" ]
4178
4279[lints .rust .unexpected_cfgs ]
4380level = " warn"
4481check-cfg = [
45- ' cfg(getrandom_backend, values("custom", "rdrand", "rndr", "linux_getrandom", "wasm_js", "esp_idf"))' ,
82+ ' cfg(getrandom_backend, values("custom", "rdrand", "rndr", "linux_getrandom", "linux_rustix", " wasm_js", "esp_idf"))' ,
4683 ' cfg(getrandom_browser_test)' ,
4784 ' cfg(getrandom_test_linux_fallback)' ,
4885]
0 commit comments