@@ -6,11 +6,9 @@ use clippy_utils::ty::{implements_trait, is_copy};
66use clippy_utils:: { ast_utils:: is_useless_with_eq_exprs, eq_expr_value, is_in_test_function} ;
77use if_chain:: if_chain;
88use 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 } ;
1210use rustc_lint:: { LateContext , LateLintPass } ;
13- use rustc_middle:: ty:: { self , TyS } ;
11+ use rustc_middle:: ty:: { self , Ty } ;
1412use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
1513
1614declare_clippy_lint ! {
@@ -279,7 +277,11 @@ impl<'tcx> LateLintPass<'tcx> for EqOp {
279277 }
280278}
281279
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 > ) > {
283285 if_chain ! {
284286 if let Some ( block) = get_enclosing_block( cx, e. hir_id) ;
285287 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
301303 }
302304}
303305
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 {
305307 if_chain ! {
306308 if let ty:: Adt ( adt_def, _) = middle_ty. kind( ) ;
307309 if let Some ( local_did) = adt_def. did. as_local( ) ;
0 commit comments