]> git.lizzy.rs Git - rust.git/blob - tests/ui/implicit_hasher.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / implicit_hasher.stderr
1 error: impl for `HashMap` should be generalized over different hashers
2   --> $DIR/implicit_hasher.rs:15:35
3    |
4 LL | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
5    |                                   ^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::implicit-hasher` implied by `-D warnings`
8 help: consider adding a type parameter
9    |
10 LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
11    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             ^^^^^^^^^^^^^^^^
12 help: ...and use generic constructor
13    |
14 LL |         (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
15    |          ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
17 error: impl for `HashMap` should be generalized over different hashers
18   --> $DIR/implicit_hasher.rs:24:36
19    |
20 LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
21    |                                    ^^^^^^^^^^^^^
22 help: consider adding a type parameter
23    |
24 LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
25    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^              ^^^^^^^^^^^^^^^^
26 help: ...and use generic constructor
27    |
28 LL |         ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
29    |           ^^^^^^^^^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error: impl for `HashMap` should be generalized over different hashers
32   --> $DIR/implicit_hasher.rs:29:19
33    |
34 LL | impl Foo<i16> for HashMap<String, String> {
35    |                   ^^^^^^^^^^^^^^^^^^^^^^^
36 help: consider adding a type parameter
37    |
38 LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
39    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^              ^^^^^^^^^^^^^^^^^^^^^^^^^^
40 help: ...and use generic constructor
41    |
42 LL |         (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
43    |          ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45 error: impl for `HashSet` should be generalized over different hashers
46   --> $DIR/implicit_hasher.rs:46:32
47    |
48 LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
49    |                                ^^^^^^^^^^
50 help: consider adding a type parameter
51    |
52 LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
53    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             ^^^^^^^^^^^^^
54 help: ...and use generic constructor
55    |
56 LL |         (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
57    |          ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
59 error: impl for `HashSet` should be generalized over different hashers
60   --> $DIR/implicit_hasher.rs:51:19
61    |
62 LL | impl Foo<i16> for HashSet<String> {
63    |                   ^^^^^^^^^^^^^^^
64 help: consider adding a type parameter
65    |
66 LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
67    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^              ^^^^^^^^^^^^^^^^^^
68 help: ...and use generic constructor
69    |
70 LL |         (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
71    |          ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72
73 error: parameter of type `HashMap` should be generalized over different hashers
74   --> $DIR/implicit_hasher.rs:68:23
75    |
76 LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
77    |                       ^^^^^^^^^^^^^^^^^
78 help: consider adding a type parameter
79    |
80 LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
81    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^            ^^^^^^^^^^^^^^^^^^^^
82
83 error: parameter of type `HashSet` should be generalized over different hashers
84   --> $DIR/implicit_hasher.rs:68:53
85    |
86 LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
87    |                                                     ^^^^^^^^^^^^
88 help: consider adding a type parameter
89    |
90 LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
91    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                          ^^^^^^^^^^^^^^^
92
93 error: impl for `HashMap` should be generalized over different hashers
94   --> $DIR/implicit_hasher.rs:72:43
95    |
96 LL |         impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
97    |                                           ^^^^^^^^^^^^^
98 ...
99 LL | gen!(impl);
100    | ----------- in this macro invocation
101 help: consider adding a type parameter
102    |
103 LL |         impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
104    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             ^^^^^^^^^^^^^^^^
105 help: ...and use generic constructor
106    |
107 LL |                 (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
108    |                  ^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109
110 error: parameter of type `HashMap` should be generalized over different hashers
111   --> $DIR/implicit_hasher.rs:80:33
112    |
113 LL |         pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
114    |                                 ^^^^^^^^^^^^^^^^^
115 ...
116 LL | gen!(fn bar);
117    | ------------- in this macro invocation
118 help: consider adding a type parameter
119    |
120 LL |         pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
121    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^            ^^^^^^^^^^^^^^^^^^^^
122
123 error: parameter of type `HashSet` should be generalized over different hashers
124   --> $DIR/implicit_hasher.rs:80:63
125    |
126 LL |         pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
127    |                                                               ^^^^^^^^^^^^
128 ...
129 LL | gen!(fn bar);
130    | ------------- in this macro invocation
131 help: consider adding a type parameter
132    |
133 LL |         pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
134    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                          ^^^^^^^^^^^^^^^
135
136 error: aborting due to 10 previous errors
137