diff --git a/.travis.yml b/.travis.yml index 4f5511c..40df879 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,7 @@ matrix: rust: stable env: TARGET=x86_64-unknown-linux-gnu - name: "x86_64-unknown-linux-gnu (Rust 1.29.0)" - rust: stable + rust: 1.29.0 env: TARGET=x86_64-unknown-linux-gnu - name: "i686-unknown-linux-gnu" env: TARGET=i686-unknown-linux-gnu CROSS=1 diff --git a/ci/run.sh b/ci/run.sh index 28f7330..99ed427 100644 --- a/ci/run.sh +++ b/ci/run.sh @@ -7,7 +7,7 @@ set -ex FEATURES="rayon,serde" if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then FEATURES="${FEATURES},nightly" - export RUSTFLAGS="$RUSTFLAGS --cfg hashbrown_deny_warnings" + export RUSTFLAGS="$RUSTFLAGS -D warnings" fi CARGO=cargo @@ -25,7 +25,7 @@ export RUSTFLAGS="$RUSTFLAGS --cfg hashbrown_deny_warnings" "${CARGO}" -vv test --target="${TARGET}" --features "${FEATURES}" "${CARGO}" -vv test --target="${TARGET}" --release -"${CARGO}" -vv test --target="${TARGET}" --features "${FEATURES}" +"${CARGO}" -vv test --target="${TARGET}" --release --features "${FEATURES}" if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then # Run benchmark on native targets, build them on non-native ones: diff --git a/clippy.toml b/clippy.toml index 5b5d8cb..d98bf2c 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -doc-valid-idents = [ "CppCon", "SwissTable", "SipHash", "HashDoS" ] \ No newline at end of file +doc-valid-idents = [ "CppCon", "SwissTable", "SipHash", "HashDoS" ] diff --git a/src/lib.rs b/src/lib.rs index 276eedc..1c0723b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,6 @@ ) )] #![warn(missing_docs)] -#![cfg_attr(hashbrown_deny_warnings, deny(warnings))] #![allow(clippy::module_name_repetitions)] #[cfg(test)] diff --git a/src/map.rs b/src/map.rs index 2780528..665c1e2 100644 --- a/src/map.rs +++ b/src/map.rs @@ -3398,7 +3398,13 @@ mod test_map { if let Err(AllocErr) = empty_bytes.try_reserve(MAX_USIZE / 8) { } else { - panic!("usize::MAX / 8 should trigger an OOM!") + // This may succeed if there is enough free memory. Attempt to + // allocate a second hashmap to ensure the allocation will fail. + let mut empty_bytes2: HashMap = HashMap::new(); + if let Err(AllocErr) = empty_bytes2.try_reserve(MAX_USIZE / 8) { + } else { + panic!("usize::MAX / 8 should trigger an OOM!"); + } } }