Avoid hashing arg names in hash of function signature
diff --git a/syntax/impls.rs b/syntax/impls.rs
index fd8162f..8762652 100644
--- a/syntax/impls.rs
+++ b/syntax/impls.rs
@@ -296,7 +296,23 @@
&& ret == ret2
&& throws == throws2
&& args.len() == args2.len()
- && args.iter().zip(args2).all(|(arg, arg2)| arg == arg2)
+ && args.iter().zip(args2).all(|(arg, arg2)| {
+ let Var {
+ doc: _,
+ attrs: _,
+ visibility: _,
+ ident: _,
+ ty,
+ } = arg;
+ let Var {
+ doc: _,
+ attrs: _,
+ visibility: _,
+ ident: _,
+ ty: ty2,
+ } = arg2;
+ ty == ty2
+ })
}
}
@@ -316,49 +332,20 @@
unsafety.is_some().hash(state);
receiver.hash(state);
for arg in args {
- arg.hash(state);
+ let Var {
+ doc: _,
+ attrs: _,
+ visibility: _,
+ ident: _,
+ ty,
+ } = arg;
+ ty.hash(state);
}
ret.hash(state);
throws.hash(state);
}
}
-impl Eq for Var {}
-
-impl PartialEq for Var {
- fn eq(&self, other: &Var) -> bool {
- let Var {
- doc: _,
- attrs: _,
- visibility: _,
- ident,
- ty,
- } = self;
- let Var {
- doc: _,
- attrs: _,
- visibility: _,
- ident: ident2,
- ty: ty2,
- } = other;
- ident == ident2 && ty == ty2
- }
-}
-
-impl Hash for Var {
- fn hash<H: Hasher>(&self, state: &mut H) {
- let Var {
- doc: _,
- attrs: _,
- visibility: _,
- ident,
- ty,
- } = self;
- ident.hash(state);
- ty.hash(state);
- }
-}
-
impl Eq for Receiver {}
impl PartialEq for Receiver {