@@ -93,22 +93,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for SeedBorrowKind<'a, 'tcx> {
9393 visit:: walk_expr ( self , expr) ;
9494 }
9595
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 ) { }
11298}
11399
114100impl < ' a , ' tcx > SeedBorrowKind < ' a , ' tcx > {
@@ -515,16 +501,12 @@ impl<'a, 'tcx, 'v> Visitor<'v> for AdjustBorrowKind<'a, 'tcx> {
515501 span : Span ,
516502 id : ast:: NodeId )
517503 {
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) ;
527506 }
507+
508+ // Skip all items; they aren't in the same context.
509+ fn visit_item ( & mut self , _: & ' v ast:: Item ) { }
528510}
529511
530512impl < ' a , ' tcx > euv:: Delegate < ' tcx > for AdjustBorrowKind < ' a , ' tcx > {
0 commit comments