|
1 |
| -error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]` |
2 |
| - --> tests/ui/implicit_hasher.rs:14:1 |
| 1 | +error: impl for `HashMap` should be generalized over different hashers |
| 2 | + --> tests/ui/implicit_hasher.rs:15: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 | + --> tests/ui/implicit_hasher.rs:2:9 |
| 9 | + | |
| 10 | +LL | #![deny(clippy::implicit_hasher)] |
| 11 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | +help: add a type parameter for `BuildHasher` |
| 13 | + | |
| 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())) |
| 19 | + | |
| 20 | + |
| 21 | +error: impl for `HashMap` should be generalized over different hashers |
| 22 | + --> tests/ui/implicit_hasher.rs:24:36 |
| 23 | + | |
| 24 | +LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) { |
| 25 | + | ^^^^^^^^^^^^^ |
| 26 | + | |
| 27 | +help: add a type parameter for `BuildHasher` |
| 28 | + | |
| 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 | + | |
| 33 | + |
| 34 | +error: impl for `HashMap` should be generalized over different hashers |
| 35 | + --> tests/ui/implicit_hasher.rs:29:19 |
| 36 | + | |
| 37 | +LL | impl Foo<i16> for HashMap<String, String> { |
| 38 | + | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 39 | + | |
| 40 | +help: add a type parameter for `BuildHasher` |
| 41 | + | |
| 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())) |
| 45 | + | |
| 46 | + |
| 47 | +error: impl for `HashSet` should be generalized over different hashers |
| 48 | + --> tests/ui/implicit_hasher.rs:46:32 |
| 49 | + | |
| 50 | +LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> { |
| 51 | + | ^^^^^^^^^^ |
| 52 | + | |
| 53 | +help: add a type parameter for `BuildHasher` |
| 54 | + | |
| 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())) |
3 | 58 | |
|
4 |
| -LL | pub trait Foo<T>: Sized { |
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^ |
6 | 59 |
|
7 |
| -error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]` |
8 |
| - --> tests/ui/implicit_hasher.rs:71:1 |
| 60 | +error: impl for `HashSet` should be generalized over different hashers |
| 61 | + --> tests/ui/implicit_hasher.rs:51:19 |
| 62 | + | |
| 63 | +LL | impl Foo<i16> for HashSet<String> { |
| 64 | + | ^^^^^^^^^^^^^^^ |
| 65 | + | |
| 66 | +help: add a type parameter for `BuildHasher` |
| 67 | + | |
| 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())) |
9 | 71 | |
|
10 |
| -LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {} |
11 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
12 | 72 |
|
13 |
| -error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]` |
14 |
| - --> tests/ui/implicit_hasher.rs:74:1 |
| 73 | +error: parameter of type `HashMap` should be generalized over different hashers |
| 74 | + --> tests/ui/implicit_hasher.rs:68:22 |
| 75 | + | |
| 76 | +LL | pub fn map(map: &mut HashMap<i32, i32>) {} |
| 77 | + | ^^^^^^^^^^^^^^^^^ |
15 | 78 | |
|
16 |
| -LL | pub mod gen { |
17 |
| - | ^^^^^^^^^^^ |
| 79 | +help: add a type parameter for `BuildHasher` |
| 80 | + | |
| 81 | +LL | pub fn map<S: ::std::hash::BuildHasher>(map: &mut HashMap<i32, i32, S>) {} |
| 82 | + | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~ |
18 | 83 |
|
19 |
| -error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]` |
20 |
| - --> tests/ui/implicit_hasher.rs:92:1 |
| 84 | +error: parameter of type `HashSet` should be generalized over different hashers |
| 85 | + --> tests/ui/implicit_hasher.rs:70:22 |
| 86 | + | |
| 87 | +LL | pub fn set(set: &mut HashSet<i32>) {} |
| 88 | + | ^^^^^^^^^^^^ |
21 | 89 | |
|
22 |
| -LL | pub mod test_macro; |
23 |
| - | ^^^^^^^^^^^^^^^^^^^ |
| 90 | +help: add a type parameter for `BuildHasher` |
| 91 | + | |
| 92 | +LL | pub fn set<S: ::std::hash::BuildHasher>(set: &mut HashSet<i32, S>) {} |
| 93 | + | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~ |
24 | 94 |
|
25 |
| -error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]` |
26 |
| - --> tests/ui/implicit_hasher.rs:96:1 |
| 95 | +error: impl for `HashMap` should be generalized over different hashers |
| 96 | + --> tests/ui/implicit_hasher.rs:76:43 |
| 97 | + | |
| 98 | +LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> { |
| 99 | + | ^^^^^^^^^^^^^ |
27 | 100 | |
|
28 |
| -LL | external! { |
29 |
| - | ^^^^^^^^^ |
| 101 | + = note: this error originates in the macro `__inline_mac_mod_gen` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 102 | +help: add a type parameter for `BuildHasher` |
| 103 | + | |
| 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())) |
30 | 107 | |
|
31 |
| - = note: this error originates in the macro `external` (in Nightly builds, run with -Z macro-backtrace for more info) |
32 | 108 |
|
33 |
| -error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]` |
34 |
| - --> tests/ui/implicit_hasher.rs:101:1 |
| 109 | +error: parameter of type `HashMap` should be generalized over different hashers |
| 110 | + --> tests/ui/implicit_hasher.rs:100:35 |
35 | 111 | |
|
36 | 112 | LL | pub async fn election_vote(_data: HashMap<i32, i32>) {}
|
37 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 113 | + | ^^^^^^^^^^^^^^^^^ |
| 114 | + | |
| 115 | +help: add a type parameter for `BuildHasher` |
| 116 | + | |
| 117 | +LL | pub async fn election_vote<S: ::std::hash::BuildHasher>(_data: HashMap<i32, i32, S>) {} |
| 118 | + | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~ |
38 | 119 |
|
39 |
| -error: aborting due to 6 previous errors |
| 120 | +error: aborting due to 9 previous errors |
40 | 121 |
|
0 commit comments