@@ -75,10 +75,10 @@ pub enum Code<'a> {
75
75
}
76
76
77
77
impl < ' a > Code < ' a > {
78
- pub fn id ( & self ) -> NodeId {
78
+ pub fn id ( & self ) -> ast :: HirId {
79
79
match * self {
80
80
Code :: FnLike ( node) => node. id ( ) ,
81
- Code :: Expr ( block) => block. id ,
81
+ Code :: Expr ( block) => block. hir_id ,
82
82
}
83
83
}
84
84
@@ -104,7 +104,7 @@ struct ItemFnParts<'a> {
104
104
vis : & ' a ast:: Visibility ,
105
105
generics : & ' a ast:: Generics ,
106
106
body : ast:: BodyId ,
107
- id : NodeId ,
107
+ id : ast :: HirId ,
108
108
span : Span ,
109
109
attrs : & ' a [ Attribute ] ,
110
110
}
@@ -114,13 +114,13 @@ struct ItemFnParts<'a> {
114
114
struct ClosureParts < ' a > {
115
115
decl : & ' a FnDecl ,
116
116
body : ast:: BodyId ,
117
- id : NodeId ,
117
+ id : ast :: HirId ,
118
118
span : Span ,
119
119
attrs : & ' a [ Attribute ] ,
120
120
}
121
121
122
122
impl < ' a > ClosureParts < ' a > {
123
- fn new ( d : & ' a FnDecl , b : ast:: BodyId , id : NodeId , s : Span , attrs : & ' a [ Attribute ] ) -> Self {
123
+ fn new ( d : & ' a FnDecl , b : ast:: BodyId , id : ast :: HirId , s : Span , attrs : & ' a [ Attribute ] ) -> Self {
124
124
ClosureParts {
125
125
decl : d,
126
126
body : b,
@@ -168,7 +168,7 @@ impl<'a> FnLikeNode<'a> {
168
168
|c : ClosureParts < ' _ > | c. span )
169
169
}
170
170
171
- pub fn id ( self ) -> NodeId {
171
+ pub fn id ( self ) -> ast :: HirId {
172
172
self . handle ( |i : ItemFnParts < ' _ > | i. id ,
173
173
|id, _, _: & ' a ast:: MethodSig , _, _, _, _| id,
174
174
|c : ClosureParts < ' _ > | c. id )
@@ -213,7 +213,7 @@ impl<'a> FnLikeNode<'a> {
213
213
214
214
fn handle < A , I , M , C > ( self , item_fn : I , method : M , closure : C ) -> A where
215
215
I : FnOnce ( ItemFnParts < ' a > ) -> A ,
216
- M : FnOnce ( NodeId ,
216
+ M : FnOnce ( ast :: HirId ,
217
217
Ident ,
218
218
& ' a ast:: MethodSig ,
219
219
Option < & ' a ast:: Visibility > ,
@@ -227,7 +227,7 @@ impl<'a> FnLikeNode<'a> {
227
227
map:: Node :: Item ( i) => match i. node {
228
228
ast:: ItemKind :: Fn ( ref decl, header, ref generics, block) =>
229
229
item_fn ( ItemFnParts {
230
- id : i. id ,
230
+ id : i. hir_id ,
231
231
ident : i. ident ,
232
232
decl : & decl,
233
233
body : block,
@@ -241,21 +241,21 @@ impl<'a> FnLikeNode<'a> {
241
241
} ,
242
242
map:: Node :: TraitItem ( ti) => match ti. node {
243
243
ast:: TraitItemKind :: Method ( ref sig, ast:: TraitMethod :: Provided ( body) ) => {
244
- method ( ti. id , ti. ident , sig, None , body, ti. span , & ti. attrs )
244
+ method ( ti. hir_id , ti. ident , sig, None , body, ti. span , & ti. attrs )
245
245
}
246
246
_ => bug ! ( "trait method FnLikeNode that is not fn-like" ) ,
247
247
} ,
248
248
map:: Node :: ImplItem ( ii) => {
249
249
match ii. node {
250
250
ast:: ImplItemKind :: Method ( ref sig, body) => {
251
- method ( ii. id , ii. ident , sig, Some ( & ii. vis ) , body, ii. span , & ii. attrs )
251
+ method ( ii. hir_id , ii. ident , sig, Some ( & ii. vis ) , body, ii. span , & ii. attrs )
252
252
}
253
253
_ => bug ! ( "impl method FnLikeNode that is not fn-like" )
254
254
}
255
255
} ,
256
256
map:: Node :: Expr ( e) => match e. node {
257
257
ast:: ExprKind :: Closure ( _, ref decl, block, _fn_decl_span, _gen) =>
258
- closure ( ClosureParts :: new ( & decl, block, e. id , e. span , & e. attrs ) ) ,
258
+ closure ( ClosureParts :: new ( & decl, block, e. hir_id , e. span , & e. attrs ) ) ,
259
259
_ => bug ! ( "expr FnLikeNode that is not fn-like" ) ,
260
260
} ,
261
261
_ => bug ! ( "other FnLikeNode that is not fn-like" ) ,
0 commit comments