@@ -6,11 +6,9 @@ use clippy_utils::ty::{implements_trait, is_copy};
6
6
use clippy_utils:: { ast_utils:: is_useless_with_eq_exprs, eq_expr_value, is_in_test_function} ;
7
7
use if_chain:: if_chain;
8
8
use rustc_errors:: Applicability ;
9
- use rustc_hir:: {
10
- def:: Res , def_id:: DefId , BinOpKind , BorrowKind , Expr , ExprKind , GenericArg , ItemKind , QPath , Ty , TyKind ,
11
- } ;
9
+ use rustc_hir:: { def:: Res , def_id:: DefId , BinOpKind , BorrowKind , Expr , ExprKind , GenericArg , ItemKind , QPath , TyKind } ;
12
10
use rustc_lint:: { LateContext , LateLintPass } ;
13
- use rustc_middle:: ty:: { self , TyS } ;
11
+ use rustc_middle:: ty:: { self , Ty } ;
14
12
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
15
13
16
14
declare_clippy_lint ! {
@@ -279,7 +277,11 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
279
277
}
280
278
}
281
279
282
- fn in_impl < ' tcx > ( cx : & LateContext < ' tcx > , e : & ' tcx Expr < ' _ > , bin_op : DefId ) -> Option < ( & ' tcx Ty < ' tcx > , & ' tcx Ty < ' tcx > ) > {
280
+ fn in_impl < ' tcx > (
281
+ cx : & LateContext < ' tcx > ,
282
+ e : & ' tcx Expr < ' _ > ,
283
+ bin_op : DefId ,
284
+ ) -> Option < ( & ' tcx rustc_hir:: Ty < ' tcx > , & ' tcx rustc_hir:: Ty < ' tcx > ) > {
283
285
if_chain ! {
284
286
if let Some ( block) = get_enclosing_block( cx, e. hir_id) ;
285
287
if let Some ( impl_def_id) = cx. tcx. impl_of_method( block. hir_id. owner. to_def_id( ) ) ;
@@ -301,7 +303,7 @@ fn in_impl<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, bin_op: DefId) -> Op
301
303
}
302
304
}
303
305
304
- fn are_equal < ' tcx > ( cx : & LateContext < ' tcx > , middle_ty : & TyS < ' _ > , hir_ty : & Ty < ' _ > ) -> bool {
306
+ fn are_equal < ' tcx > ( cx : & LateContext < ' tcx > , middle_ty : Ty < ' _ > , hir_ty : & rustc_hir :: Ty < ' _ > ) -> bool {
305
307
if_chain ! {
306
308
if let ty:: Adt ( adt_def, _) = middle_ty. kind( ) ;
307
309
if let Some ( local_did) = adt_def. did. as_local( ) ;
0 commit comments