diff --git a/Cargo.toml b/Cargo.toml index 3e6fc93d5d..995d84ab94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } @@ -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"] diff --git a/README.md b/README.md index d33561e63a..5c9c063784 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,10 @@ This crate has the following Cargo features: - `raw`: Enables access to the experimental and unsafe `RawTable` API. - `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost of compilation time. (enabled by default) +- `ahash`: Compiles with ahash as default hasher. (enabled by default) +- `ahash-compile-time-rng`: Activates the `compile-time-rng` feature of ahash, to increase the + DOS-resistance, but can result in issues for `no_std` builds. More details in + [issue#124](https://github.com/rust-lang/hashbrown/issues/124). (enabled by default) ## License diff --git a/src/lib.rs b/src/lib.rs index acf1a709f4..fc33c32b69 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,8 +22,12 @@ cfg_doctest, ) )] +#![allow( + clippy::doc_markdown, + clippy::module_name_repetitions, + clippy::must_use_candidate +)] #![warn(missing_docs)] -#![allow(clippy::module_name_repetitions, clippy::doc_markdown)] #![warn(rust_2018_idioms)] #[cfg(test)]