@@ -148,7 +148,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers {
148148 hir:: ItemKind :: Struct ( ref struct_def, _) |
149149 hir:: ItemKind :: Union ( ref struct_def, _) => {
150150 for struct_field in struct_def. fields ( ) {
151- let def_id = cx. tcx . hir ( ) . local_def_id ( struct_field. id ) ;
151+ let def_id = cx. tcx . hir ( ) . local_def_id_from_hir_id ( struct_field. hir_id ) ;
152152 self . check_heap_type ( cx, struct_field. span ,
153153 cx. tcx . type_of ( def_id) ) ;
154154 }
@@ -560,7 +560,8 @@ impl LintPass for MissingCopyImplementations {
560560
561561impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for MissingCopyImplementations {
562562 fn check_item ( & mut self , cx : & LateContext < ' _ , ' _ > , item : & hir:: Item ) {
563- if !cx. access_levels . is_reachable ( item. id ) {
563+ let node_id = cx. tcx . hir ( ) . hir_to_node_id ( item. hir_id ) ;
564+ if !cx. access_levels . is_reachable ( node_id) {
564565 return ;
565566 }
566567 let ( def, ty) = match item. node {
@@ -631,7 +632,8 @@ impl LintPass for MissingDebugImplementations {
631632
632633impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for MissingDebugImplementations {
633634 fn check_item ( & mut self , cx : & LateContext < ' _ , ' _ > , item : & hir:: Item ) {
634- if !cx. access_levels . is_reachable ( item. id ) {
635+ let node_id = cx. tcx . hir ( ) . hir_to_node_id ( item. hir_id ) ;
636+ if !cx. access_levels . is_reachable ( node_id) {
635637 return ;
636638 }
637639
@@ -1078,7 +1080,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnionsWithDropFields {
10781080 fn check_item ( & mut self , ctx : & LateContext < ' _ , ' _ > , item : & hir:: Item ) {
10791081 if let hir:: ItemKind :: Union ( ref vdata, _) = item. node {
10801082 for field in vdata. fields ( ) {
1081- let field_ty = ctx. tcx . type_of ( ctx. tcx . hir ( ) . local_def_id ( field. id ) ) ;
1083+ let field_ty = ctx. tcx . type_of (
1084+ ctx. tcx . hir ( ) . local_def_id_from_hir_id ( field. hir_id ) ) ;
10821085 if field_ty. needs_drop ( ctx. tcx , ctx. param_env ) {
10831086 ctx. span_lint ( UNIONS_WITH_DROP_FIELDS ,
10841087 field. span ,
0 commit comments