Skip to content

Commit b8fbeea

Browse files
committed
Add rustc-dep-of-std feature
This is how `libc` and `hashbrown` support being dependancies of `libstd`. This allows `getrandom` to use `core` normally, and use the sysroot `core` when building `libstd`.
1 parent 199b115 commit b8fbeea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ members = ["tests/wasm_bindgen"]
2121
log = { version = "0.4", optional = true }
2222
cfg-if = "0.1"
2323

24+
# When built as part of libstd
25+
compiler_builtins = { version = "0.1", optional = true }
26+
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
27+
2428
[target.'cfg(any(unix, target_os = "redox", target_os = "wasi"))'.dependencies]
2529
libc = "0.2.60"
2630

@@ -30,3 +34,5 @@ stdweb = { version = "0.4.18", optional = true }
3034

3135
[features]
3236
std = []
37+
# Unstable feature to support being a libstd dependancy
38+
rustc-dep-of-std = ["compiler_builtins", "core"]

0 commit comments

Comments
 (0)