11error: impl for `HashMap` should be generalized over different hashers
2- --> tests/ui/implicit_hasher.rs:17 :35
2+ --> tests/ui/implicit_hasher.rs:15 :35
33 |
44LL | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
55 | ^^^^^^^^^^^^^
66 |
77note: the lint level is defined here
8- --> tests/ui/implicit_hasher.rs:3 :9
8+ --> tests/ui/implicit_hasher.rs:2 :9
99 |
1010LL | #![deny(clippy::implicit_hasher)]
1111 | ^^^^^^^^^^^^^^^^^^^^^^^
12- help: consider adding a type parameter
12+ help: add a type parameter for `BuildHasher`
1313 |
14- LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
15- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
16- help: ...and use generic constructor
14+ LL ~ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
15+ LL | fn make() -> (Self, Self) {
16+ ...
17+ LL |
18+ LL ~ (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
1719 |
18- LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
19- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020
2121error: impl for `HashMap` should be generalized over different hashers
22- --> tests/ui/implicit_hasher.rs:26 :36
22+ --> tests/ui/implicit_hasher.rs:24 :36
2323 |
2424LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
2525 | ^^^^^^^^^^^^^
2626 |
27- help: consider adding a type parameter
27+ help: add a type parameter for `BuildHasher`
2828 |
29- LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
30- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
31- help: ...and use generic constructor
29+ LL ~ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
30+ LL | fn make() -> (Self, Self) {
31+ LL ~ ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
3232 |
33- LL | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
34- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3533
3634error: impl for `HashMap` should be generalized over different hashers
37- --> tests/ui/implicit_hasher.rs:31 :19
35+ --> tests/ui/implicit_hasher.rs:29 :19
3836 |
3937LL | impl Foo<i16> for HashMap<String, String> {
4038 | ^^^^^^^^^^^^^^^^^^^^^^^
4139 |
42- help: consider adding a type parameter
40+ help: add a type parameter for `BuildHasher`
4341 |
44- LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
45- | +++++++++++++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~
46- help: ...and use generic constructor
42+ LL ~ impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
43+ LL | fn make() -> (Self, Self) {
44+ LL ~ (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
4745 |
48- LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
49- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5046
5147error: impl for `HashSet` should be generalized over different hashers
52- --> tests/ui/implicit_hasher.rs:48 :32
48+ --> tests/ui/implicit_hasher.rs:46 :32
5349 |
5450LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
5551 | ^^^^^^^^^^
5652 |
57- help: consider adding a type parameter
53+ help: add a type parameter for `BuildHasher`
5854 |
59- LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
60- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
61- help: ...and use generic constructor
55+ LL ~ impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
56+ LL | fn make() -> (Self, Self) {
57+ LL ~ (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
6258 |
63- LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
64- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6559
6660error: impl for `HashSet` should be generalized over different hashers
67- --> tests/ui/implicit_hasher.rs:53 :19
61+ --> tests/ui/implicit_hasher.rs:51 :19
6862 |
6963LL | impl Foo<i16> for HashSet<String> {
7064 | ^^^^^^^^^^^^^^^
7165 |
72- help: consider adding a type parameter
66+ help: add a type parameter for `BuildHasher`
7367 |
74- LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
75- | +++++++++++++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~
76- help: ...and use generic constructor
68+ LL ~ impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
69+ LL | fn make() -> (Self, Self) {
70+ LL ~ (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
7771 |
78- LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
79- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8072
8173error: parameter of type `HashMap` should be generalized over different hashers
82- --> tests/ui/implicit_hasher.rs:70:23
74+ --> tests/ui/implicit_hasher.rs:68:22
8375 |
84- LL | pub fn foo(_map : &mut HashMap<i32, i32>, _set: &mut HashSet< i32>) {}
85- | ^^^^^^^^^^^^^^^^^
76+ LL | pub fn map(map : &mut HashMap<i32, i32>) {}
77+ | ^^^^^^^^^^^^^^^^^
8678 |
87- help: consider adding a type parameter
79+ help: add a type parameter for `BuildHasher`
8880 |
89- LL | pub fn foo <S: ::std::hash::BuildHasher>(_map : &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32 >) {}
90- | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
81+ LL | pub fn map <S: ::std::hash::BuildHasher>(map : &mut HashMap<i32, i32, S>) {}
82+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
9183
9284error: parameter of type `HashSet` should be generalized over different hashers
93- --> tests/ui/implicit_hasher.rs:70:53
85+ --> tests/ui/implicit_hasher.rs:70:22
9486 |
95- LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set : &mut HashSet<i32>) {}
96- | ^^^^^^^^^^^^
87+ LL | pub fn set(set : &mut HashSet<i32>) {}
88+ | ^^^^^^^^^^^^
9789 |
98- help: consider adding a type parameter
90+ help: add a type parameter for `BuildHasher`
9991 |
100- LL | pub fn foo <S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set : &mut HashSet<i32, S>) {}
101- | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~
92+ LL | pub fn set <S: ::std::hash::BuildHasher>(set : &mut HashSet<i32, S>) {}
93+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~
10294
10395error: impl for `HashMap` should be generalized over different hashers
10496 --> tests/ui/implicit_hasher.rs:76:43
@@ -107,22 +99,20 @@ LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
10799 | ^^^^^^^^^^^^^
108100 |
109101 = note: this error originates in the macro `__inline_mac_mod_gen` (in Nightly builds, run with -Z macro-backtrace for more info)
110- help: consider adding a type parameter
102+ help: add a type parameter for `BuildHasher`
111103 |
112- LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
113- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
114- help: ...and use generic constructor
104+ LL ~ impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
105+ LL | fn make() -> (Self, Self) {
106+ LL ~ (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
115107 |
116- LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
117- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118108
119109error: parameter of type `HashMap` should be generalized over different hashers
120110 --> tests/ui/implicit_hasher.rs:100:35
121111 |
122112LL | pub async fn election_vote(_data: HashMap<i32, i32>) {}
123113 | ^^^^^^^^^^^^^^^^^
124114 |
125- help: consider adding a type parameter
115+ help: add a type parameter for `BuildHasher`
126116 |
127117LL | pub async fn election_vote<S: ::std::hash::BuildHasher>(_data: HashMap<i32, i32, S>) {}
128118 | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
0 commit comments