Skip to content

Commit

Permalink
Introduce ahash-compile-time-rng feature.
Browse files Browse the repository at this point in the history
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 dependend crate targeting `no_std`,
which contains `rand` or `rand_core` somewhere inside the dependency
tree as a bug in cargo accidently enables the underlying `getrandom`
feature if `compile-time-rng` is enabled [1].

... fixes rust-lang#124

[1] rust-lang/cargo#5760
  • Loading branch information
0ndorio committed Oct 30, 2019
1 parent 861a110 commit 3fe2350
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build = "build.rs"

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

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

[features]
default = ["ahash", "inline-more"]
default = [
"ahash",
"ahash-compile-time-rng",
"inline-more",
]

ahash-compile-time-rng = [ "ahash/compile-time-rng" ]
nightly = []
rustc-internal-api = []
rustc-dep-of-std = ["nightly", "core", "compiler_builtins", "alloc", "rustc-internal-api"]
Expand Down

0 comments on commit 3fe2350

Please sign in to comment.