1//-
2// Copyright 2017, 2018 The proptest developers
3//
4// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7// option. This file may not be copied, modified, or distributed
8// except according to those terms.
910//! Arbitrary implementations for `std::hash`.
1112#[cfg(feature = "std")]
13use crate::std_facade::hash_map::{DefaultHasher, RandomState};
14use core::hash::{BuildHasherDefault, Hasher};
1516// NOTE: don't impl for std::hash::SipHasher.. since deprecated!
1718// over-constrain on purpose!
19arbitrary!([H: Default + Hasher] BuildHasherDefault<H>; Default::default());
2021#[cfg(feature = "std")]
22lazy_just!(DefaultHasher, Default::default; RandomState, Default::default);
2324#[cfg(test)]
25mod test {
26#[cfg(feature = "std")]
27no_panic_test!(
28 default_hasher => DefaultHasher,
29 random_state => RandomState,
30 build_hasher_default => BuildHasherDefault<DefaultHasher>
31 );
32}