@@ -1112,11 +1112,12 @@ impl LintPass for UnreachablePub {
1112
1112
}
1113
1113
1114
1114
impl 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 ,
1116
1116
vis : & hir:: Visibility , span : Span , exportable : bool ) {
1117
1117
let mut applicability = Applicability :: MachineApplicable ;
1118
+ let node_id = cx. tcx . hir ( ) . hir_to_node_id ( id) ;
1118
1119
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 ) => {
1120
1121
if span. ctxt ( ) . outer ( ) . expn_info ( ) . is_some ( ) {
1121
1122
applicability = Applicability :: MaybeIncorrect ;
1122
1123
}
@@ -1148,20 +1149,20 @@ impl UnreachablePub {
1148
1149
1149
1150
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for UnreachablePub {
1150
1151
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 ) ;
1152
1153
}
1153
1154
1154
1155
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 ,
1156
1157
foreign_item. span , true ) ;
1157
1158
}
1158
1159
1159
1160
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 ) ;
1161
1162
}
1162
1163
1163
1164
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 ) ;
1165
1166
}
1166
1167
}
1167
1168
0 commit comments