Skip to content

Commit 2907d9b

Browse files
committed
Introduce ahash-compile-time-rng feature.
Disables the default features of `ahash` and reintroduces them through a new feature called `ahash-compile-time-rng`, which is enabled by default. The new feature makes it possible for depended crates to rely on `hashbrown` with `ahash` as default hasher and to disable the `compile-time-rng` at the same time. This might be useful for any dependent crate targeting `no_std`, which contains `rand` or `rand_core` somewhere inside the dependency tree as a bug in cargo accidentally enables the underlying `getrandom` feature if `compile-time-rng` is enabled [1]. ... fixes #124 [1] rust-lang/cargo#5760
1 parent 861a110 commit 2907d9b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Cargo.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build = "build.rs"
1414

1515
[dependencies]
1616
# For the default hasher
17-
ahash = { version = "0.2.11", optional = true }
17+
ahash = { version = "0.2.11", optional = true, default-features = false }
1818

1919
# For external trait impls
2020
rayon = { version = "1.0", optional = true }
@@ -37,7 +37,13 @@ serde_test = "1.0"
3737
doc-comment = "0.3.1"
3838

3939
[features]
40-
default = ["ahash", "inline-more"]
40+
default = [
41+
"ahash",
42+
"ahash-compile-time-rng",
43+
"inline-more",
44+
]
45+
46+
ahash-compile-time-rng = [ "ahash/compile-time-rng" ]
4147
nightly = []
4248
rustc-internal-api = []
4349
rustc-dep-of-std = ["nightly", "core", "compiler_builtins", "alloc", "rustc-internal-api"]

0 commit comments

Comments
 (0)