@@ -5,10 +5,9 @@ use clippy_utils::{eq_expr_value, get_trait_def_id, paths};
55use if_chain:: if_chain;
66use rustc_ast:: ast:: LitKind ;
77use rustc_errors:: Applicability ;
8- use rustc_hir:: intravisit:: { walk_expr, FnKind , NestedVisitorMap , Visitor } ;
8+ use rustc_hir:: intravisit:: { walk_expr, FnKind , Visitor } ;
99use rustc_hir:: { BinOpKind , Body , Expr , ExprKind , FnDecl , HirId , UnOp } ;
1010use rustc_lint:: { LateContext , LateLintPass } ;
11- use rustc_middle:: hir:: map:: Map ;
1211use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
1312use rustc_span:: source_map:: Span ;
1413use rustc_span:: sym;
@@ -260,7 +259,7 @@ fn simplify_not(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<String> {
260259 ) )
261260 } )
262261 } ,
263- ExprKind :: MethodCall ( path, _ , args, _) if args. len ( ) == 1 => {
262+ ExprKind :: MethodCall ( path, args, _) if args. len ( ) == 1 => {
264263 let type_of_receiver = cx. typeck_results ( ) . expr_ty ( & args[ 0 ] ) ;
265264 if !is_type_diagnostic_item ( cx, type_of_receiver, sym:: Option )
266265 && !is_type_diagnostic_item ( cx, type_of_receiver, sym:: Result )
@@ -452,8 +451,6 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
452451}
453452
454453impl < ' a , ' tcx > Visitor < ' tcx > for NonminimalBoolVisitor < ' a , ' tcx > {
455- type Map = Map < ' tcx > ;
456-
457454 fn visit_expr ( & mut self , e : & ' tcx Expr < ' _ > ) {
458455 if !e. span . from_expansion ( ) {
459456 match & e. kind {
@@ -470,9 +467,6 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
470467 }
471468 walk_expr ( self , e) ;
472469 }
473- fn nested_visit_map ( & mut self ) -> NestedVisitorMap < Self :: Map > {
474- NestedVisitorMap :: None
475- }
476470}
477471
478472fn implements_ord < ' tcx > ( cx : & LateContext < ' tcx > , expr : & Expr < ' _ > ) -> bool {
@@ -485,8 +479,6 @@ struct NotSimplificationVisitor<'a, 'tcx> {
485479}
486480
487481impl < ' a , ' tcx > Visitor < ' tcx > for NotSimplificationVisitor < ' a , ' tcx > {
488- type Map = Map < ' tcx > ;
489-
490482 fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
491483 if let ExprKind :: Unary ( UnOp :: Not , inner) = & expr. kind {
492484 if let Some ( suggestion) = simplify_not ( self . cx , inner) {
@@ -504,7 +496,4 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
504496
505497 walk_expr ( self , expr) ;
506498 }
507- fn nested_visit_map ( & mut self ) -> NestedVisitorMap < Self :: Map > {
508- NestedVisitorMap :: None
509- }
510499}
0 commit comments