@@ -1112,11 +1112,12 @@ impl LintPass for UnreachablePub {
11121112}
11131113
11141114impl UnreachablePub {
1115- fn perform_lint ( & self , cx : & LateContext < ' _ , ' _ > , what : & str , id : ast :: NodeId ,
1115+ fn perform_lint ( & self , cx : & LateContext < ' _ , ' _ > , what : & str , id : hir :: HirId ,
11161116 vis : & hir:: Visibility , span : Span , exportable : bool ) {
11171117 let mut applicability = Applicability :: MachineApplicable ;
1118+ let node_id = cx. tcx . hir ( ) . hir_to_node_id ( id) ;
11181119 match vis. node {
1119- hir:: VisibilityKind :: Public if !cx. access_levels . is_reachable ( id ) => {
1120+ hir:: VisibilityKind :: Public if !cx. access_levels . is_reachable ( node_id ) => {
11201121 if span. ctxt ( ) . outer ( ) . expn_info ( ) . is_some ( ) {
11211122 applicability = Applicability :: MaybeIncorrect ;
11221123 }
@@ -1148,20 +1149,20 @@ impl UnreachablePub {
11481149
11491150impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for UnreachablePub {
11501151 fn check_item ( & mut self , cx : & LateContext < ' _ , ' _ > , item : & hir:: Item ) {
1151- self . perform_lint ( cx, "item" , item. id , & item. vis , item. span , true ) ;
1152+ self . perform_lint ( cx, "item" , item. hir_id , & item. vis , item. span , true ) ;
11521153 }
11531154
11541155 fn check_foreign_item ( & mut self , cx : & LateContext < ' _ , ' _ > , foreign_item : & hir:: ForeignItem ) {
1155- self . perform_lint ( cx, "item" , foreign_item. id , & foreign_item. vis ,
1156+ self . perform_lint ( cx, "item" , foreign_item. hir_id , & foreign_item. vis ,
11561157 foreign_item. span , true ) ;
11571158 }
11581159
11591160 fn check_struct_field ( & mut self , cx : & LateContext < ' _ , ' _ > , field : & hir:: StructField ) {
1160- self . perform_lint ( cx, "field" , field. id , & field. vis , field. span , false ) ;
1161+ self . perform_lint ( cx, "field" , field. hir_id , & field. vis , field. span , false ) ;
11611162 }
11621163
11631164 fn check_impl_item ( & mut self , cx : & LateContext < ' _ , ' _ > , impl_item : & hir:: ImplItem ) {
1164- self . perform_lint ( cx, "item" , impl_item. id , & impl_item. vis , impl_item. span , false ) ;
1165+ self . perform_lint ( cx, "item" , impl_item. hir_id , & impl_item. vis , impl_item. span , false ) ;
11651166 }
11661167}
11671168
0 commit comments