]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/implicit_hasher.stderr
Rollup merge of #88858 - spektom:to_lower_upper_rev, r=dtolnay
[rust.git] / src / tools / clippy / tests / ui / implicit_hasher.stderr
1 error: impl for `HashMap` should be generalized over different hashers
2   --> $DIR/implicit_hasher.rs:16:35
3    |
4 LL | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
5    |                                   ^^^^^^^^^^^^^
6    |
7 note: the lint level is defined here
8   --> $DIR/implicit_hasher.rs:2:9
9    |
10 LL | #![deny(clippy::implicit_hasher)]
11    |         ^^^^^^^^^^^^^^^^^^^^^^^
12 help: consider adding a type parameter
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
17    |
18 LL |         (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
19    |          ~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20
21 error: impl for `HashMap` should be generalized over different hashers
22   --> $DIR/implicit_hasher.rs:25:36
23    |
24 LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
25    |                                    ^^^^^^^^^^^^^
26    |
27 help: consider adding a type parameter
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
32    |
33 LL |         ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
34    |           ~~~~~~~~~~~~~~~~~~     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35
36 error: impl for `HashMap` should be generalized over different hashers
37   --> $DIR/implicit_hasher.rs:30:19
38    |
39 LL | impl Foo<i16> for HashMap<String, String> {
40    |                   ^^^^^^^^^^^^^^^^^^^^^^^
41    |
42 help: consider adding a type parameter
43    |
44 LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
45    |     +++++++++++++++++++++++++++++++++++++++              ~~~~~~~~~~~~~~~~~~~~~~~~~~
46 help: ...and use generic constructor
47    |
48 LL |         (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
49    |          ~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
51 error: impl for `HashSet` should be generalized over different hashers
52   --> $DIR/implicit_hasher.rs:47:32
53    |
54 LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
55    |                                ^^^^^^^^^^
56    |
57 help: consider adding a type parameter
58    |
59 LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
60    |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~~~~~~~~~~
61 help: ...and use generic constructor
62    |
63 LL |         (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
64    |          ~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65
66 error: impl for `HashSet` should be generalized over different hashers
67   --> $DIR/implicit_hasher.rs:52:19
68    |
69 LL | impl Foo<i16> for HashSet<String> {
70    |                   ^^^^^^^^^^^^^^^
71    |
72 help: consider adding a type parameter
73    |
74 LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
75    |     +++++++++++++++++++++++++++++++++++++++              ~~~~~~~~~~~~~~~~~~
76 help: ...and use generic constructor
77    |
78 LL |         (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
79    |          ~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80
81 error: parameter of type `HashMap` should be generalized over different hashers
82   --> $DIR/implicit_hasher.rs:69:23
83    |
84 LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
85    |                       ^^^^^^^^^^^^^^^^^
86    |
87 help: consider adding a type parameter
88    |
89 LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
90    |           +++++++++++++++++++++++++++++            ~~~~~~~~~~~~~~~~~~~~
91
92 error: parameter of type `HashSet` should be generalized over different hashers
93   --> $DIR/implicit_hasher.rs:69:53
94    |
95 LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
96    |                                                     ^^^^^^^^^^^^
97    |
98 help: consider adding a type parameter
99    |
100 LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
101    |           +++++++++++++++++++++++++++++                                          ~~~~~~~~~~~~~~~
102
103 error: impl for `HashMap` should be generalized over different hashers
104   --> $DIR/implicit_hasher.rs:73:43
105    |
106 LL |         impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
107    |                                           ^^^^^^^^^^^^^
108 ...
109 LL | gen!(impl);
110    | ---------- in this macro invocation
111    |
112    = note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
113 help: consider adding a type parameter
114    |
115 LL |         impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
116    |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             ~~~~~~~~~~~~~~~~
117 help: ...and use generic constructor
118    |
119 LL |                 (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
120    |                  ~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
122 error: parameter of type `HashMap` should be generalized over different hashers
123   --> $DIR/implicit_hasher.rs:81:33
124    |
125 LL |         pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
126    |                                 ^^^^^^^^^^^^^^^^^
127 ...
128 LL | gen!(fn bar);
129    | ------------ in this macro invocation
130    |
131    = note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
132 help: consider adding a type parameter
133    |
134 LL |         pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
135    |                     +++++++++++++++++++++++++++++            ~~~~~~~~~~~~~~~~~~~~
136
137 error: parameter of type `HashSet` should be generalized over different hashers
138   --> $DIR/implicit_hasher.rs:81:63
139    |
140 LL |         pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
141    |                                                               ^^^^^^^^^^^^
142 ...
143 LL | gen!(fn bar);
144    | ------------ in this macro invocation
145    |
146    = note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
147 help: consider adding a type parameter
148    |
149 LL |         pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
150    |                     +++++++++++++++++++++++++++++                                          ~~~~~~~~~~~~~~~
151
152 error: parameter of type `HashMap` should be generalized over different hashers
153   --> $DIR/implicit_hasher.rs:100:35
154    |
155 LL | pub async fn election_vote(_data: HashMap<i32, i32>) {}
156    |                                   ^^^^^^^^^^^^^^^^^
157    |
158 help: consider adding a type parameter
159    |
160 LL | pub async fn election_vote<S: ::std::hash::BuildHasher>(_data: HashMap<i32, i32, S>) {}
161    |                           +++++++++++++++++++++++++++++        ~~~~~~~~~~~~~~~~~~~~
162
163 error: aborting due to 11 previous errors
164