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