@@ -10,7 +10,6 @@ use rustc::ty;
1010use rustc:: { declare_tool_lint, lint_array} ;
1111use rustc_errors:: Applicability ;
1212use std:: borrow:: Cow ;
13- use syntax:: ast:: NodeId ;
1413use syntax:: source_map:: Span ;
1514use syntax_pos:: MultiSpan ;
1615
@@ -111,18 +110,19 @@ impl LintPass for PointerPass {
111110impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for PointerPass {
112111 fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx Item ) {
113112 if let ItemKind :: Fn ( ref decl, _, _, body_id) = item. node {
114- check_fn ( cx, decl, item. id , Some ( body_id) ) ;
113+ check_fn ( cx, decl, item. hir_id , Some ( body_id) ) ;
115114 }
116115 }
117116
118117 fn check_impl_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx ImplItem ) {
119118 if let ImplItemKind :: Method ( ref sig, body_id) = item. node {
120- if let Some ( Node :: Item ( it) ) = cx. tcx . hir ( ) . find ( cx. tcx . hir ( ) . get_parent ( item. id ) ) {
119+ let parent_item = cx. tcx . hir ( ) . get_parent_item ( item. hir_id ) ;
120+ if let Some ( Node :: Item ( it) ) = cx. tcx . hir ( ) . find_by_hir_id ( parent_item) {
121121 if let ItemKind :: Impl ( _, _, _, _, Some ( _) , _, _) = it. node {
122122 return ; // ignore trait impls
123123 }
124124 }
125- check_fn ( cx, & sig. decl , item. id , Some ( body_id) ) ;
125+ check_fn ( cx, & sig. decl , item. hir_id , Some ( body_id) ) ;
126126 }
127127 }
128128
@@ -133,7 +133,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PointerPass {
133133 } else {
134134 None
135135 } ;
136- check_fn ( cx, & sig. decl , item. id , body_id) ;
136+ check_fn ( cx, & sig. decl , item. hir_id , body_id) ;
137137 }
138138 }
139139
@@ -152,8 +152,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PointerPass {
152152}
153153
154154#[ allow( clippy:: too_many_lines) ]
155- fn check_fn ( cx : & LateContext < ' _ , ' _ > , decl : & FnDecl , fn_id : NodeId , opt_body_id : Option < BodyId > ) {
156- let fn_def_id = cx. tcx . hir ( ) . local_def_id ( fn_id) ;
155+ fn check_fn ( cx : & LateContext < ' _ , ' _ > , decl : & FnDecl , fn_id : HirId , opt_body_id : Option < BodyId > ) {
156+ let fn_def_id = cx. tcx . hir ( ) . local_def_id_from_hir_id ( fn_id) ;
157157 let sig = cx. tcx . fn_sig ( fn_def_id) ;
158158 let fn_ty = sig. skip_binder ( ) ;
159159
0 commit comments