1
1
error: 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
3
3
|
4
4
LL | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
5
5
| ^^^^^^^^^^^^^
6
6
|
7
7
note: the lint level is defined here
8
- --> tests/ui/implicit_hasher.rs:3 :9
8
+ --> tests/ui/implicit_hasher.rs:2 :9
9
9
|
10
10
LL | #![deny(clippy::implicit_hasher)]
11
11
| ^^^^^^^^^^^^^^^^^^^^^^^
12
- help: consider adding a type parameter
12
+ help: add a type parameter for `BuildHasher`
13
13
|
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()))
17
19
|
18
- LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
19
- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
20
21
21
error: 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
23
23
|
24
24
LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
25
25
| ^^^^^^^^^^^^^
26
26
|
27
- help: consider adding a type parameter
27
+ help: add a type parameter for `BuildHasher`
28
28
|
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()),))
32
32
|
33
- LL | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
34
- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
33
36
34
error: 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
38
36
|
39
37
LL | impl Foo<i16> for HashMap<String, String> {
40
38
| ^^^^^^^^^^^^^^^^^^^^^^^
41
39
|
42
- help: consider adding a type parameter
40
+ help: add a type parameter for `BuildHasher`
43
41
|
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()))
47
45
|
48
- LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
49
- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
46
51
47
error: 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
53
49
|
54
50
LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
55
51
| ^^^^^^^^^^
56
52
|
57
- help: consider adding a type parameter
53
+ help: add a type parameter for `BuildHasher`
58
54
|
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()))
62
58
|
63
- LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
64
- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
59
66
60
error: 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
68
62
|
69
63
LL | impl Foo<i16> for HashSet<String> {
70
64
| ^^^^^^^^^^^^^^^
71
65
|
72
- help: consider adding a type parameter
66
+ help: add a type parameter for `BuildHasher`
73
67
|
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()))
77
71
|
78
- LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
79
- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80
72
81
73
error: 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
83
75
|
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
+ | ^^^^^^^^^^^^^^^^^
86
78
|
87
- help: consider adding a type parameter
79
+ help: add a type parameter for `BuildHasher`
88
80
|
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
+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
91
83
92
84
error: 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
94
86
|
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
+ | ^^^^^^^^^^^^
97
89
|
98
- help: consider adding a type parameter
90
+ help: add a type parameter for `BuildHasher`
99
91
|
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
+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~
102
94
103
95
error: impl for `HashMap` should be generalized over different hashers
104
96
--> tests/ui/implicit_hasher.rs:76:43
@@ -107,22 +99,20 @@ LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
107
99
| ^^^^^^^^^^^^^
108
100
|
109
101
= 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`
111
103
|
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()))
115
107
|
116
- LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
117
- | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118
108
119
109
error: parameter of type `HashMap` should be generalized over different hashers
120
110
--> tests/ui/implicit_hasher.rs:100:35
121
111
|
122
112
LL | pub async fn election_vote(_data: HashMap<i32, i32>) {}
123
113
| ^^^^^^^^^^^^^^^^^
124
114
|
125
- help: consider adding a type parameter
115
+ help: add a type parameter for `BuildHasher`
126
116
|
127
117
LL | pub async fn election_vote<S: ::std::hash::BuildHasher>(_data: HashMap<i32, i32, S>) {}
128
118
| +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
0 commit comments