@@ -10,7 +10,6 @@ use rustc::ty;
10
10
use rustc:: { declare_tool_lint, lint_array} ;
11
11
use rustc_errors:: Applicability ;
12
12
use std:: borrow:: Cow ;
13
- use syntax:: ast:: NodeId ;
14
13
use syntax:: source_map:: Span ;
15
14
use syntax_pos:: MultiSpan ;
16
15
@@ -111,18 +110,19 @@ impl LintPass for PointerPass {
111
110
impl < ' a , ' tcx > LateLintPass < ' a , ' tcx > for PointerPass {
112
111
fn check_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx Item ) {
113
112
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) ) ;
115
114
}
116
115
}
117
116
118
117
fn check_impl_item ( & mut self , cx : & LateContext < ' a , ' tcx > , item : & ' tcx ImplItem ) {
119
118
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) {
121
121
if let ItemKind :: Impl ( _, _, _, _, Some ( _) , _, _) = it. node {
122
122
return ; // ignore trait impls
123
123
}
124
124
}
125
- check_fn ( cx, & sig. decl , item. id , Some ( body_id) ) ;
125
+ check_fn ( cx, & sig. decl , item. hir_id , Some ( body_id) ) ;
126
126
}
127
127
}
128
128
@@ -133,7 +133,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PointerPass {
133
133
} else {
134
134
None
135
135
} ;
136
- check_fn ( cx, & sig. decl , item. id , body_id) ;
136
+ check_fn ( cx, & sig. decl , item. hir_id , body_id) ;
137
137
}
138
138
}
139
139
@@ -152,8 +152,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PointerPass {
152
152
}
153
153
154
154
#[ 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) ;
157
157
let sig = cx. tcx . fn_sig ( fn_def_id) ;
158
158
let fn_ty = sig. skip_binder ( ) ;
159
159
0 commit comments