@@ -103,8 +103,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
103
103
( & ExprKind :: Lit ( ..) , _) | ( _, & ExprKind :: Lit ( ..) ) => { } ,
104
104
// &foo == &bar
105
105
( & ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref l) , & ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref r) ) => {
106
- let lty = cx. tables . expr_ty ( l) ;
107
- let rty = cx. tables . expr_ty ( r) ;
106
+ let lty = cx. tables ( ) . expr_ty ( l) ;
107
+ let rty = cx. tables ( ) . expr_ty ( r) ;
108
108
let lcpy = is_copy ( cx, lty) ;
109
109
let rcpy = is_copy ( cx, rty) ;
110
110
// either operator autorefs or both args are copyable
@@ -126,7 +126,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
126
126
)
127
127
} else if lcpy
128
128
&& !rcpy
129
- && implements_trait ( cx, lty, trait_id, & [ cx. tables . expr_ty ( right) . into ( ) ] )
129
+ && implements_trait ( cx, lty, trait_id, & [ cx. tables ( ) . expr_ty ( right) . into ( ) ] )
130
130
{
131
131
span_lint_and_then (
132
132
cx,
@@ -145,7 +145,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
145
145
)
146
146
} else if !lcpy
147
147
&& rcpy
148
- && implements_trait ( cx, cx. tables . expr_ty ( left) , trait_id, & [ rty. into ( ) ] )
148
+ && implements_trait ( cx, cx. tables ( ) . expr_ty ( left) , trait_id, & [ rty. into ( ) ] )
149
149
{
150
150
span_lint_and_then (
151
151
cx,
@@ -166,10 +166,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
166
166
} ,
167
167
// &foo == bar
168
168
( & ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref l) , _) => {
169
- let lty = cx. tables . expr_ty ( l) ;
169
+ let lty = cx. tables ( ) . expr_ty ( l) ;
170
170
let lcpy = is_copy ( cx, lty) ;
171
171
if ( requires_ref || lcpy)
172
- && implements_trait ( cx, lty, trait_id, & [ cx. tables . expr_ty ( right) . into ( ) ] )
172
+ && implements_trait ( cx, lty, trait_id, & [ cx. tables ( ) . expr_ty ( right) . into ( ) ] )
173
173
{
174
174
span_lint_and_then (
175
175
cx,
@@ -190,10 +190,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
190
190
} ,
191
191
// foo == &bar
192
192
( _, & ExprKind :: AddrOf ( BorrowKind :: Ref , _, ref r) ) => {
193
- let rty = cx. tables . expr_ty ( r) ;
193
+ let rty = cx. tables ( ) . expr_ty ( r) ;
194
194
let rcpy = is_copy ( cx, rty) ;
195
195
if ( requires_ref || rcpy)
196
- && implements_trait ( cx, cx. tables . expr_ty ( left) , trait_id, & [ rty. into ( ) ] )
196
+ && implements_trait ( cx, cx. tables ( ) . expr_ty ( left) , trait_id, & [ rty. into ( ) ] )
197
197
{
198
198
span_lint_and_then ( cx, OP_REF , e. span , "taken reference of right operand" , |diag| {
199
199
let rsnip = snippet ( cx, r. span , "..." ) . to_string ( ) ;
0 commit comments