@@ -18,31 +18,68 @@ cfg-if = "1"
18
18
compiler_builtins = { version = " 0.1" , optional = true }
19
19
core = { version = " 1.0" , optional = true , package = " rustc-std-workspace-core" }
20
20
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 ]
22
23
libc = { version = " 0.2.154" , default-features = false }
23
24
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)
24
58
[target .'cfg(all(target_arch = "wasm32", target_os = "wasi", target_env = "p2"))' .dependencies ]
25
59
wasi = { version = " 0.13" , default-features = false }
26
60
61
+ # windows7
27
62
[target .'cfg(all(windows, not(target_vendor = "win7")))' .dependencies ]
28
63
windows-targets = " 0.52"
29
64
65
+ # wasm_js
30
66
[target .'cfg(all(getrandom_backend = "wasm_js", any(target_arch = "wasm32", target_arch = "wasm64"), target_os = "unknown"))' .dependencies ]
31
67
wasm-bindgen = { version = " 0.2.89" , default-features = false }
32
68
js-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 ]
34
70
wasm-bindgen-test = " 0.3.39"
35
71
36
72
[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
38
75
std = []
39
76
# Unstable feature to support being a libstd dependency
40
77
rustc-dep-of-std = [" compiler_builtins" , " core" ]
41
78
42
79
[lints .rust .unexpected_cfgs ]
43
80
level = " warn"
44
81
check-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"))' ,
46
83
' cfg(getrandom_browser_test)' ,
47
84
' cfg(getrandom_test_linux_fallback)' ,
48
85
]
0 commit comments