@@ -237,7 +237,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
237
237
}
238
238
}
239
239
240
- impl < ' a , ' tcx > Visitor for MarkSymbolVisitor < ' a , ' tcx > {
240
+ impl < ' a , ' tcx , ' v > Visitor < ' v > for MarkSymbolVisitor < ' a , ' tcx > {
241
241
242
242
fn visit_struct_def ( & mut self , def : & ast:: StructDef , _: ast:: Ident ,
243
243
_: & ast:: Generics , _: ast:: NodeId ) {
@@ -329,7 +329,7 @@ struct LifeSeeder {
329
329
worklist : Vec < ast:: NodeId > ,
330
330
}
331
331
332
- impl Visitor for LifeSeeder {
332
+ impl < ' v > Visitor < ' v > for LifeSeeder {
333
333
fn visit_item ( & mut self , item : & ast:: Item ) {
334
334
if has_allow_dead_code_or_lang_attr ( item. attrs . as_slice ( ) ) {
335
335
self . worklist . push ( item. id ) ;
@@ -349,11 +349,11 @@ impl Visitor for LifeSeeder {
349
349
visit:: walk_item ( self , item) ;
350
350
}
351
351
352
- fn visit_fn ( & mut self , fk : & visit:: FnKind ,
353
- _: & ast:: FnDecl , block : & ast:: Block ,
352
+ fn visit_fn ( & mut self , fk : visit:: FnKind < ' v > ,
353
+ _: & ' v ast:: FnDecl , block : & ' v ast:: Block ,
354
354
_: codemap:: Span , id : ast:: NodeId ) {
355
355
// Check for method here because methods are not ast::Item
356
- match * fk {
356
+ match fk {
357
357
visit:: FkMethod ( _, _, method) => {
358
358
if has_allow_dead_code_or_lang_attr ( method. attrs . as_slice ( ) ) {
359
359
self . worklist . push ( id) ;
@@ -499,7 +499,7 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
499
499
}
500
500
}
501
501
502
- impl < ' a , ' tcx > Visitor for DeadVisitor < ' a , ' tcx > {
502
+ impl < ' a , ' tcx , ' v > Visitor < ' v > for DeadVisitor < ' a , ' tcx > {
503
503
fn visit_item ( & mut self , item : & ast:: Item ) {
504
504
let ctor_id = get_struct_ctor_id ( item) ;
505
505
if !self . symbol_is_live ( item. id , ctor_id) && should_warn ( item) {
@@ -515,15 +515,14 @@ impl<'a, 'tcx> Visitor for DeadVisitor<'a, 'tcx> {
515
515
visit:: walk_foreign_item ( self , fi) ;
516
516
}
517
517
518
- fn visit_fn ( & mut self , fk : & visit:: FnKind ,
519
- _: & ast:: FnDecl , block : & ast:: Block ,
518
+ fn visit_fn ( & mut self , fk : visit:: FnKind < ' v > ,
519
+ _: & ' v ast:: FnDecl , block : & ' v ast:: Block ,
520
520
span : codemap:: Span , id : ast:: NodeId ) {
521
521
// Have to warn method here because methods are not ast::Item
522
- match * fk {
523
- visit:: FkMethod ( ..) => {
524
- let ident = visit:: name_of_fn ( fk) ;
522
+ match fk {
523
+ visit:: FkMethod ( name, _, _) => {
525
524
if !self . symbol_is_live ( id, None ) {
526
- self . warn_dead_code ( id, span, ident ) ;
525
+ self . warn_dead_code ( id, span, name ) ;
527
526
}
528
527
}
529
528
_ => ( )
0 commit comments