@@ -117,7 +117,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
117
117
collector. insert_entry ( CRATE_NODE_ID , Entry {
118
118
parent : ast:: DUMMY_NODE_ID ,
119
119
dep_node : root_mod_sig_dep_index,
120
- node : NodeKind :: Crate ,
120
+ node : Node :: Crate ,
121
121
} ) ;
122
122
123
123
collector
@@ -190,7 +190,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
190
190
self . map [ id. as_usize ( ) ] = Some ( entry) ;
191
191
}
192
192
193
- fn insert ( & mut self , id : NodeId , node : NodeKind < ' hir > ) {
193
+ fn insert ( & mut self , id : NodeId , node : Node < ' hir > ) {
194
194
let entry = Entry {
195
195
parent : self . parent_node ,
196
196
dep_node : if self . currently_in_body {
@@ -309,13 +309,13 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
309
309
debug_assert_eq ! ( i. hir_id. owner,
310
310
self . definitions. opt_def_index( i. id) . unwrap( ) ) ;
311
311
self . with_dep_node_owner ( i. hir_id . owner , i, |this| {
312
- this. insert ( i. id , NodeKind :: Item ( i) ) ;
312
+ this. insert ( i. id , Node :: Item ( i) ) ;
313
313
this. with_parent ( i. id , |this| {
314
314
match i. node {
315
315
ItemKind :: Struct ( ref struct_def, _) => {
316
316
// If this is a tuple-like struct, register the constructor.
317
317
if !struct_def. is_struct ( ) {
318
- this. insert ( struct_def. id ( ) , NodeKind :: StructCtor ( struct_def) ) ;
318
+ this. insert ( struct_def. id ( ) , Node :: StructCtor ( struct_def) ) ;
319
319
}
320
320
}
321
321
_ => { }
@@ -326,23 +326,23 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
326
326
}
327
327
328
328
fn visit_foreign_item ( & mut self , foreign_item : & ' hir ForeignItem ) {
329
- self . insert ( foreign_item. id , NodeKind :: ForeignItem ( foreign_item) ) ;
329
+ self . insert ( foreign_item. id , Node :: ForeignItem ( foreign_item) ) ;
330
330
331
331
self . with_parent ( foreign_item. id , |this| {
332
332
intravisit:: walk_foreign_item ( this, foreign_item) ;
333
333
} ) ;
334
334
}
335
335
336
336
fn visit_generic_param ( & mut self , param : & ' hir GenericParam ) {
337
- self . insert ( param. id , NodeKind :: GenericParam ( param) ) ;
337
+ self . insert ( param. id , Node :: GenericParam ( param) ) ;
338
338
intravisit:: walk_generic_param ( self , param) ;
339
339
}
340
340
341
341
fn visit_trait_item ( & mut self , ti : & ' hir TraitItem ) {
342
342
debug_assert_eq ! ( ti. hir_id. owner,
343
343
self . definitions. opt_def_index( ti. id) . unwrap( ) ) ;
344
344
self . with_dep_node_owner ( ti. hir_id . owner , ti, |this| {
345
- this. insert ( ti. id , NodeKind :: TraitItem ( ti) ) ;
345
+ this. insert ( ti. id , Node :: TraitItem ( ti) ) ;
346
346
347
347
this. with_parent ( ti. id , |this| {
348
348
intravisit:: walk_trait_item ( this, ti) ;
@@ -354,7 +354,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
354
354
debug_assert_eq ! ( ii. hir_id. owner,
355
355
self . definitions. opt_def_index( ii. id) . unwrap( ) ) ;
356
356
self . with_dep_node_owner ( ii. hir_id . owner , ii, |this| {
357
- this. insert ( ii. id , NodeKind :: ImplItem ( ii) ) ;
357
+ this. insert ( ii. id , Node :: ImplItem ( ii) ) ;
358
358
359
359
this. with_parent ( ii. id , |this| {
360
360
intravisit:: walk_impl_item ( this, ii) ;
@@ -364,9 +364,9 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
364
364
365
365
fn visit_pat ( & mut self , pat : & ' hir Pat ) {
366
366
let node = if let PatKind :: Binding ( ..) = pat. node {
367
- NodeKind :: Binding ( pat)
367
+ Node :: Binding ( pat)
368
368
} else {
369
- NodeKind :: Pat ( pat)
369
+ Node :: Pat ( pat)
370
370
} ;
371
371
self . insert ( pat. id , node) ;
372
372
@@ -376,15 +376,15 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
376
376
}
377
377
378
378
fn visit_anon_const ( & mut self , constant : & ' hir AnonConst ) {
379
- self . insert ( constant. id , NodeKind :: AnonConst ( constant) ) ;
379
+ self . insert ( constant. id , Node :: AnonConst ( constant) ) ;
380
380
381
381
self . with_parent ( constant. id , |this| {
382
382
intravisit:: walk_anon_const ( this, constant) ;
383
383
} ) ;
384
384
}
385
385
386
386
fn visit_expr ( & mut self , expr : & ' hir Expr ) {
387
- self . insert ( expr. id , NodeKind :: Expr ( expr) ) ;
387
+ self . insert ( expr. id , Node :: Expr ( expr) ) ;
388
388
389
389
self . with_parent ( expr. id , |this| {
390
390
intravisit:: walk_expr ( this, expr) ;
@@ -393,23 +393,23 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
393
393
394
394
fn visit_stmt ( & mut self , stmt : & ' hir Stmt ) {
395
395
let id = stmt. node . id ( ) ;
396
- self . insert ( id, NodeKind :: Stmt ( stmt) ) ;
396
+ self . insert ( id, Node :: Stmt ( stmt) ) ;
397
397
398
398
self . with_parent ( id, |this| {
399
399
intravisit:: walk_stmt ( this, stmt) ;
400
400
} ) ;
401
401
}
402
402
403
403
fn visit_ty ( & mut self , ty : & ' hir Ty ) {
404
- self . insert ( ty. id , NodeKind :: Ty ( ty) ) ;
404
+ self . insert ( ty. id , Node :: Ty ( ty) ) ;
405
405
406
406
self . with_parent ( ty. id , |this| {
407
407
intravisit:: walk_ty ( this, ty) ;
408
408
} ) ;
409
409
}
410
410
411
411
fn visit_trait_ref ( & mut self , tr : & ' hir TraitRef ) {
412
- self . insert ( tr. ref_id , NodeKind :: TraitRef ( tr) ) ;
412
+ self . insert ( tr. ref_id , Node :: TraitRef ( tr) ) ;
413
413
414
414
self . with_parent ( tr. ref_id , |this| {
415
415
intravisit:: walk_trait_ref ( this, tr) ;
@@ -423,21 +423,21 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
423
423
}
424
424
425
425
fn visit_block ( & mut self , block : & ' hir Block ) {
426
- self . insert ( block. id , NodeKind :: Block ( block) ) ;
426
+ self . insert ( block. id , Node :: Block ( block) ) ;
427
427
self . with_parent ( block. id , |this| {
428
428
intravisit:: walk_block ( this, block) ;
429
429
} ) ;
430
430
}
431
431
432
432
fn visit_local ( & mut self , l : & ' hir Local ) {
433
- self . insert ( l. id , NodeKind :: Local ( l) ) ;
433
+ self . insert ( l. id , Node :: Local ( l) ) ;
434
434
self . with_parent ( l. id , |this| {
435
435
intravisit:: walk_local ( this, l)
436
436
} )
437
437
}
438
438
439
439
fn visit_lifetime ( & mut self , lifetime : & ' hir Lifetime ) {
440
- self . insert ( lifetime. id , NodeKind :: Lifetime ( lifetime) ) ;
440
+ self . insert ( lifetime. id , Node :: Lifetime ( lifetime) ) ;
441
441
}
442
442
443
443
fn visit_vis ( & mut self , visibility : & ' hir Visibility ) {
@@ -446,7 +446,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
446
446
VisibilityKind :: Crate ( _) |
447
447
VisibilityKind :: Inherited => { }
448
448
VisibilityKind :: Restricted { id, .. } => {
449
- self . insert ( id, NodeKind :: Visibility ( visibility) ) ;
449
+ self . insert ( id, Node :: Visibility ( visibility) ) ;
450
450
self . with_parent ( id, |this| {
451
451
intravisit:: walk_vis ( this, visibility) ;
452
452
} ) ;
@@ -458,20 +458,20 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
458
458
let def_index = self . definitions . opt_def_index ( macro_def. id ) . unwrap ( ) ;
459
459
460
460
self . with_dep_node_owner ( def_index, macro_def, |this| {
461
- this. insert ( macro_def. id , NodeKind :: MacroDef ( macro_def) ) ;
461
+ this. insert ( macro_def. id , Node :: MacroDef ( macro_def) ) ;
462
462
} ) ;
463
463
}
464
464
465
465
fn visit_variant ( & mut self , v : & ' hir Variant , g : & ' hir Generics , item_id : NodeId ) {
466
466
let id = v. node . data . id ( ) ;
467
- self . insert ( id, NodeKind :: Variant ( v) ) ;
467
+ self . insert ( id, Node :: Variant ( v) ) ;
468
468
self . with_parent ( id, |this| {
469
469
intravisit:: walk_variant ( this, v, g, item_id) ;
470
470
} ) ;
471
471
}
472
472
473
473
fn visit_struct_field ( & mut self , field : & ' hir StructField ) {
474
- self . insert ( field. id , NodeKind :: Field ( field) ) ;
474
+ self . insert ( field. id , Node :: Field ( field) ) ;
475
475
self . with_parent ( field. id , |this| {
476
476
intravisit:: walk_struct_field ( this, field) ;
477
477
} ) ;
0 commit comments