mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Support ExprType
(type ascription) comparison
*ish
This commit is contained in:
parent
3e009b9424
commit
e036a8145a
1 changed files with 7 additions and 3 deletions
|
@ -85,7 +85,10 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
|
|||
(&ExprCall(ref l_fun, ref l_args), &ExprCall(ref r_fun, ref r_args)) => {
|
||||
!self.ignore_fn && self.eq_expr(l_fun, r_fun) && self.eq_exprs(l_args, r_args)
|
||||
}
|
||||
(&ExprCast(ref lx, ref lt), &ExprCast(ref rx, ref rt)) => self.eq_expr(lx, rx) && self.eq_ty(lt, rt),
|
||||
(&ExprCast(ref lx, ref lt), &ExprCast(ref rx, ref rt)) |
|
||||
(&ExprType(ref lx, ref lt), &ExprType(ref rx, ref rt)) => {
|
||||
self.eq_expr(lx, rx) && self.eq_ty(lt, rt)
|
||||
}
|
||||
(&ExprField(ref l_f_exp, ref l_f_ident), &ExprField(ref r_f_exp, ref r_f_ident)) => {
|
||||
l_f_ident.node == r_f_ident.node && self.eq_expr(l_f_exp, r_f_exp)
|
||||
}
|
||||
|
@ -474,10 +477,11 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
|
|||
self.hash_expr(le);
|
||||
li.node.hash(&mut self.s);
|
||||
}
|
||||
ExprType(_, _) => {
|
||||
ExprType(ref e, ref _ty) => {
|
||||
let c: fn(_, _) -> _ = ExprType;
|
||||
c.hash(&mut self.s);
|
||||
// what’s an ExprType anyway?
|
||||
self.hash_expr(e);
|
||||
// TODO: _ty
|
||||
}
|
||||
ExprUnary(lop, ref le) => {
|
||||
let c: fn(_, _) -> _ = ExprUnary;
|
||||
|
|
Loading…
Reference in a new issue