@@ -221,9 +221,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for MarkSymbolVisitor<'a, 'tcx> {
221221 let has_extern_repr = self . struct_has_extern_repr ;
222222 let inherited_pub_visibility = self . inherited_pub_visibility ;
223223 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
225225 } ) ;
226- self . live_symbols . extend ( live_fields. map ( |f| f. node . id ) ) ;
226+ self . live_symbols . extend ( live_fields. map ( |f| f. id ) ) ;
227227
228228 intravisit:: walk_struct_def ( self , def) ;
229229 }
@@ -428,16 +428,16 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
428428 should_warn && !self . symbol_is_live ( item. id , ctor_id)
429429 }
430430
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 ) ;
433433 let is_marker_field = match field_type. ty_to_def_id ( ) {
434434 Some ( def_id) => self . tcx . lang_items . items ( ) . iter ( ) . any ( |item| * item == Some ( def_id) ) ,
435435 _ => false
436436 } ;
437- !node . is_positional ( )
438- && !self . symbol_is_live ( node . id , None )
437+ !field . is_positional ( )
438+ && !self . symbol_is_live ( field . id , None )
439439 && !is_marker_field
440- && !has_allow_dead_code_or_lang_attr ( & node . attrs )
440+ && !has_allow_dead_code_or_lang_attr ( & field . attrs )
441441 }
442442
443443 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> {
543543 }
544544
545545 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" ) ;
549549 }
550550
551551 intravisit:: walk_struct_field ( self , field) ;
0 commit comments