mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-25 11:57:25 +00:00
commit
2f225d8228
2 changed files with 12 additions and 12 deletions
|
@ -1561,7 +1561,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
|
||||||
cx,
|
cx,
|
||||||
IMPLICIT_HASHER,
|
IMPLICIT_HASHER,
|
||||||
target.span(),
|
target.span(),
|
||||||
&format!("impl for `{}` should be generarized over different hashers", target.type_name()),
|
&format!("impl for `{}` should be generalized over different hashers", target.type_name()),
|
||||||
move |db| {
|
move |db| {
|
||||||
suggestion(cx, db, generics.span, generics_suggestion_span, target, ctr_vis);
|
suggestion(cx, db, generics.span, generics_suggestion_span, target, ctr_vis);
|
||||||
},
|
},
|
||||||
|
@ -1595,7 +1595,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher {
|
||||||
IMPLICIT_HASHER,
|
IMPLICIT_HASHER,
|
||||||
target.span(),
|
target.span(),
|
||||||
&format!(
|
&format!(
|
||||||
"parameter of type `{}` should be generarized over different hashers",
|
"parameter of type `{}` should be generalized over different hashers",
|
||||||
target.type_name()
|
target.type_name()
|
||||||
),
|
),
|
||||||
move |db| {
|
move |db| {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error: impl for `HashMap` should be generarized over different hashers
|
error: impl for `HashMap` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:11:35
|
--> $DIR/implicit_hasher.rs:11:35
|
||||||
|
|
|
|
||||||
11 | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
|
11 | impl<K: Hash + Eq, V> Foo<i8> for HashMap<K, V> {
|
||||||
|
@ -14,7 +14,7 @@ help: ...and use generic constructor
|
||||||
17 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
|
17 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: impl for `HashMap` should be generarized over different hashers
|
error: impl for `HashMap` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:20:36
|
--> $DIR/implicit_hasher.rs:20:36
|
||||||
|
|
|
|
||||||
20 | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
|
20 | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
|
||||||
|
@ -29,7 +29,7 @@ help: ...and use generic constructor
|
||||||
22 | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
|
22 | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: impl for `HashMap` should be generarized over different hashers
|
error: impl for `HashMap` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:25:19
|
--> $DIR/implicit_hasher.rs:25:19
|
||||||
|
|
|
|
||||||
25 | impl Foo<i16> for HashMap<String, String> {
|
25 | impl Foo<i16> for HashMap<String, String> {
|
||||||
|
@ -44,7 +44,7 @@ help: ...and use generic constructor
|
||||||
27 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
|
27 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: impl for `HashSet` should be generarized over different hashers
|
error: impl for `HashSet` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:43:32
|
--> $DIR/implicit_hasher.rs:43:32
|
||||||
|
|
|
|
||||||
43 | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
|
43 | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
|
||||||
|
@ -59,7 +59,7 @@ help: ...and use generic constructor
|
||||||
45 | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
|
45 | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: impl for `HashSet` should be generarized over different hashers
|
error: impl for `HashSet` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:48:19
|
--> $DIR/implicit_hasher.rs:48:19
|
||||||
|
|
|
|
||||||
48 | impl Foo<i16> for HashSet<String> {
|
48 | impl Foo<i16> for HashSet<String> {
|
||||||
|
@ -74,7 +74,7 @@ help: ...and use generic constructor
|
||||||
50 | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
|
50 | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: parameter of type `HashMap` should be generarized over different hashers
|
error: parameter of type `HashMap` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:65:23
|
--> $DIR/implicit_hasher.rs:65:23
|
||||||
|
|
|
|
||||||
65 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
65 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
||||||
|
@ -85,7 +85,7 @@ help: consider adding a type parameter
|
||||||
65 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {
|
65 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: parameter of type `HashSet` should be generarized over different hashers
|
error: parameter of type `HashSet` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:65:53
|
--> $DIR/implicit_hasher.rs:65:53
|
||||||
|
|
|
|
||||||
65 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
65 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
||||||
|
@ -96,7 +96,7 @@ help: consider adding a type parameter
|
||||||
65 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {
|
65 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: impl for `HashMap` should be generarized over different hashers
|
error: impl for `HashMap` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:70:43
|
--> $DIR/implicit_hasher.rs:70:43
|
||||||
|
|
|
|
||||||
70 | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
|
70 | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
|
||||||
|
@ -114,7 +114,7 @@ help: ...and use generic constructor
|
||||||
72 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
|
72 | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: parameter of type `HashMap` should be generarized over different hashers
|
error: parameter of type `HashMap` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:78:33
|
--> $DIR/implicit_hasher.rs:78:33
|
||||||
|
|
|
|
||||||
78 | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
78 | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
||||||
|
@ -128,7 +128,7 @@ help: consider adding a type parameter
|
||||||
78 | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {
|
78 | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: parameter of type `HashSet` should be generarized over different hashers
|
error: parameter of type `HashSet` should be generalized over different hashers
|
||||||
--> $DIR/implicit_hasher.rs:78:63
|
--> $DIR/implicit_hasher.rs:78:63
|
||||||
|
|
|
|
||||||
78 | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
78 | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue