diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/implicit_hasher.fixed')
| -rw-r--r-- | src/tools/clippy/tests/ui/implicit_hasher.fixed | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/implicit_hasher.fixed b/src/tools/clippy/tests/ui/implicit_hasher.fixed index 971746ae95d..bea5b9afc43 100644 --- a/src/tools/clippy/tests/ui/implicit_hasher.fixed +++ b/src/tools/clippy/tests/ui/implicit_hasher.fixed @@ -13,6 +13,7 @@ pub trait Foo<T>: Sized { } impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> { + //~^ implicit_hasher fn make() -> (Self, Self) { // OK, don't suggest to modify these let _: HashMap<i32, i32> = HashMap::new(); @@ -22,11 +23,13 @@ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap } } impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) { + //~^ implicit_hasher fn make() -> (Self, Self) { ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),)) } } impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> { + //~^ implicit_hasher fn make() -> (Self, Self) { (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default())) } @@ -44,11 +47,13 @@ impl<S: BuildHasher + Default> Foo<i64> for HashMap<String, String, S> { } impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> { + //~^ implicit_hasher fn make() -> (Self, Self) { (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default())) } } impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> { + //~^ implicit_hasher fn make() -> (Self, Self) { (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default())) } @@ -66,14 +71,17 @@ impl<S: BuildHasher + Default> Foo<i64> for HashSet<String, S> { } pub fn map<S: ::std::hash::BuildHasher>(map: &mut HashMap<i32, i32, S>) {} +//~^ implicit_hasher pub fn set<S: ::std::hash::BuildHasher>(set: &mut HashSet<i32, S>) {} +//~^ implicit_hasher #[inline_macros] pub mod gen_ { use super::*; inline! { impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> { + //~^ implicit_hasher fn make() -> (Self, Self) { (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default())) } @@ -98,5 +106,6 @@ external! { // #7712 pub async fn election_vote<S: ::std::hash::BuildHasher>(_data: HashMap<i32, i32, S>) {} +//~^ implicit_hasher fn main() {} |
