@@ -5,10 +5,9 @@ use clippy_utils::{eq_expr_value, get_trait_def_id, paths};
5
5
use if_chain:: if_chain;
6
6
use rustc_ast:: ast:: LitKind ;
7
7
use rustc_errors:: Applicability ;
8
- use rustc_hir:: intravisit:: { walk_expr, FnKind , NestedVisitorMap , Visitor } ;
8
+ use rustc_hir:: intravisit:: { walk_expr, FnKind , Visitor } ;
9
9
use rustc_hir:: { BinOpKind , Body , Expr , ExprKind , FnDecl , HirId , UnOp } ;
10
10
use rustc_lint:: { LateContext , LateLintPass } ;
11
- use rustc_middle:: hir:: map:: Map ;
12
11
use rustc_session:: { declare_lint_pass, declare_tool_lint} ;
13
12
use rustc_span:: source_map:: Span ;
14
13
use rustc_span:: sym;
@@ -260,7 +259,7 @@ fn simplify_not(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<String> {
260
259
) )
261
260
} )
262
261
} ,
263
- ExprKind :: MethodCall ( path, _ , args, _) if args. len ( ) == 1 => {
262
+ ExprKind :: MethodCall ( path, args, _) if args. len ( ) == 1 => {
264
263
let type_of_receiver = cx. typeck_results ( ) . expr_ty ( & args[ 0 ] ) ;
265
264
if !is_type_diagnostic_item ( cx, type_of_receiver, sym:: Option )
266
265
&& !is_type_diagnostic_item ( cx, type_of_receiver, sym:: Result )
@@ -452,8 +451,6 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
452
451
}
453
452
454
453
impl < ' a , ' tcx > Visitor < ' tcx > for NonminimalBoolVisitor < ' a , ' tcx > {
455
- type Map = Map < ' tcx > ;
456
-
457
454
fn visit_expr ( & mut self , e : & ' tcx Expr < ' _ > ) {
458
455
if !e. span . from_expansion ( ) {
459
456
match & e. kind {
@@ -470,9 +467,6 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
470
467
}
471
468
walk_expr ( self , e) ;
472
469
}
473
- fn nested_visit_map ( & mut self ) -> NestedVisitorMap < Self :: Map > {
474
- NestedVisitorMap :: None
475
- }
476
470
}
477
471
478
472
fn implements_ord < ' tcx > ( cx : & LateContext < ' tcx > , expr : & Expr < ' _ > ) -> bool {
@@ -485,8 +479,6 @@ struct NotSimplificationVisitor<'a, 'tcx> {
485
479
}
486
480
487
481
impl < ' a , ' tcx > Visitor < ' tcx > for NotSimplificationVisitor < ' a , ' tcx > {
488
- type Map = Map < ' tcx > ;
489
-
490
482
fn visit_expr ( & mut self , expr : & ' tcx Expr < ' _ > ) {
491
483
if let ExprKind :: Unary ( UnOp :: Not , inner) = & expr. kind {
492
484
if let Some ( suggestion) = simplify_not ( self . cx , inner) {
@@ -504,7 +496,4 @@ impl<'a, 'tcx> Visitor<'tcx> for NotSimplificationVisitor<'a, 'tcx> {
504
496
505
497
walk_expr ( self , expr) ;
506
498
}
507
- fn nested_visit_map ( & mut self ) -> NestedVisitorMap < Self :: Map > {
508
- NestedVisitorMap :: None
509
- }
510
499
}
0 commit comments