@@ -93,22 +93,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for SeedBorrowKind<'a, 'tcx> {
93
93
visit:: walk_expr ( self , expr) ;
94
94
}
95
95
96
- fn visit_fn ( & mut self ,
97
- fn_kind : visit:: FnKind < ' v > ,
98
- decl : & ' v ast:: FnDecl ,
99
- block : & ' v ast:: Block ,
100
- span : Span ,
101
- _id : ast:: NodeId )
102
- {
103
- match fn_kind {
104
- visit:: FkItemFn ( ..) | visit:: FkMethod ( ..) => {
105
- // ignore nested fn items
106
- }
107
- visit:: FkFnBlock => {
108
- visit:: walk_fn ( self , fn_kind, decl, block, span) ;
109
- }
110
- }
111
- }
96
+ // Skip all items; they aren't in the same context.
97
+ fn visit_item ( & mut self , _: & ' v ast:: Item ) { }
112
98
}
113
99
114
100
impl < ' a , ' tcx > SeedBorrowKind < ' a , ' tcx > {
@@ -515,16 +501,12 @@ impl<'a, 'tcx, 'v> Visitor<'v> for AdjustBorrowKind<'a, 'tcx> {
515
501
span : Span ,
516
502
id : ast:: NodeId )
517
503
{
518
- match fn_kind {
519
- visit:: FkItemFn ( ..) | visit:: FkMethod ( ..) => {
520
- // ignore nested fn items
521
- }
522
- visit:: FkFnBlock => {
523
- visit:: walk_fn ( self , fn_kind, decl, body, span) ;
524
- self . analyze_closure ( id, span, decl, body) ;
525
- }
526
- }
504
+ visit:: walk_fn ( self , fn_kind, decl, body, span) ;
505
+ self . analyze_closure ( id, span, decl, body) ;
527
506
}
507
+
508
+ // Skip all items; they aren't in the same context.
509
+ fn visit_item ( & mut self , _: & ' v ast:: Item ) { }
528
510
}
529
511
530
512
impl < ' a , ' tcx > euv:: Delegate < ' tcx > for AdjustBorrowKind < ' a , ' tcx > {
0 commit comments