@@ -221,9 +221,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> {
221
221
let has_extern_repr = self . struct_has_extern_repr ;
222
222
let inherited_pub_visibility = self . inherited_pub_visibility ;
223
223
let live_fields = def. fields ( ) . iter ( ) . filter ( |f| {
224
- has_extern_repr || inherited_pub_visibility || f. node . vis == hir:: Public
224
+ has_extern_repr || inherited_pub_visibility || f. vis == hir:: Public
225
225
} ) ;
226
- self . live_symbols . extend ( live_fields. map ( |f| f. node . id ) ) ;
226
+ self . live_symbols . extend ( live_fields. map ( |f| f. id ) ) ;
227
227
228
228
intravisit:: walk_struct_def ( self , def) ;
229
229
}
@@ -428,16 +428,16 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
428
428
should_warn && !self . symbol_is_live ( item. id , ctor_id)
429
429
}
430
430
431
- fn should_warn_about_field ( & mut self , node : & hir:: StructField_ ) -> bool {
432
- let field_type = self . tcx . node_id_to_type ( node . id ) ;
431
+ fn should_warn_about_field ( & mut self , field : & hir:: StructField ) -> bool {
432
+ let field_type = self . tcx . node_id_to_type ( field . id ) ;
433
433
let is_marker_field = match field_type. ty_to_def_id ( ) {
434
434
Some ( def_id) => self . tcx . lang_items . items ( ) . iter ( ) . any ( |item| * item == Some ( def_id) ) ,
435
435
_ => false
436
436
} ;
437
- !node . is_positional ( )
438
- && !self . symbol_is_live ( node . id , None )
437
+ !field . is_positional ( )
438
+ && !self . symbol_is_live ( field . id , None )
439
439
&& !is_marker_field
440
- && !has_allow_dead_code_or_lang_attr ( & node . attrs )
440
+ && !has_allow_dead_code_or_lang_attr ( & field . attrs )
441
441
}
442
442
443
443
fn should_warn_about_variant ( & mut self , variant : & hir:: Variant_ ) -> bool {
@@ -543,9 +543,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DeadVisitor<'a, 'tcx> {
543
543
}
544
544
545
545
fn visit_struct_field ( & mut self , field : & hir:: StructField ) {
546
- if self . should_warn_about_field ( & field. node ) {
547
- self . warn_dead_code ( field. node . id , field. span ,
548
- field. node . name , "struct field" ) ;
546
+ if self . should_warn_about_field ( & field) {
547
+ self . warn_dead_code ( field. id , field. span ,
548
+ field. name , "struct field" ) ;
549
549
}
550
550
551
551
intravisit:: walk_struct_field ( self , field) ;
0 commit comments