@@ -27,7 +27,7 @@ pub(super) struct NodeCollector<'a, 'hir> {
27
27
/// The node map
28
28
map : Vec < Option < Entry < ' hir > > > ,
29
29
/// The parent of this node
30
- parent_hir : hir:: HirId ,
30
+ parent_node : hir:: HirId ,
31
31
32
32
// These fields keep track of the currently relevant DepNodes during
33
33
// the visitor's traversal.
@@ -147,7 +147,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
147
147
krate,
148
148
source_map : sess. source_map ( ) ,
149
149
map : repeat ( None ) . take ( sess. current_node_id_count ( ) ) . collect ( ) ,
150
- parent_hir : hir:: CRATE_HIR_ID ,
150
+ parent_node : hir:: CRATE_HIR_ID ,
151
151
current_signature_dep_index : root_mod_sig_dep_index,
152
152
current_full_dep_index : root_mod_full_dep_index,
153
153
current_dep_node_owner : CRATE_DEF_INDEX ,
@@ -230,8 +230,8 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
230
230
231
231
fn insert ( & mut self , span : Span , hir_id : HirId , node : Node < ' hir > ) {
232
232
let entry = Entry {
233
- parent : self . hir_to_node_id [ & self . parent_hir ] ,
234
- parent_hir : self . parent_hir ,
233
+ parent : self . hir_to_node_id [ & self . parent_node ] ,
234
+ parent_hir : self . parent_node ,
235
235
dep_node : if self . currently_in_body {
236
236
self . current_full_dep_index
237
237
} else {
@@ -283,13 +283,13 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
283
283
284
284
fn with_parent < F : FnOnce ( & mut Self ) > (
285
285
& mut self ,
286
- parent_hir_id : HirId ,
286
+ parent_node_id : HirId ,
287
287
f : F ,
288
288
) {
289
- let parent_hir = self . parent_hir ;
290
- self . parent_hir = parent_hir_id ;
289
+ let parent_node = self . parent_node ;
290
+ self . parent_node = parent_node_id ;
291
291
f ( self ) ;
292
- self . parent_hir = parent_hir ;
292
+ self . parent_node = parent_node ;
293
293
}
294
294
295
295
fn with_dep_node_owner < T : for < ' b > HashStable < StableHashingContext < ' b > > ,
@@ -446,8 +446,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
446
446
}
447
447
448
448
fn visit_path_segment ( & mut self , path_span : Span , path_segment : & ' hir PathSegment ) {
449
- if path_segment. id . is_some ( ) {
450
- let hir_id = path_segment. hir_id . unwrap ( ) ;
449
+ if let Some ( hir_id) = path_segment. hir_id {
451
450
self . insert ( path_span, hir_id, Node :: PathSegment ( path_segment) ) ;
452
451
}
453
452
intravisit:: walk_path_segment ( self , path_span, path_segment) ;
@@ -471,7 +470,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
471
470
472
471
fn visit_fn ( & mut self , fk : intravisit:: FnKind < ' hir > , fd : & ' hir FnDecl ,
473
472
b : BodyId , s : Span , id : HirId ) {
474
- assert_eq ! ( self . parent_hir , id) ;
473
+ assert_eq ! ( self . parent_node , id) ;
475
474
intravisit:: walk_fn ( self , fk, fd, b, s, id) ;
476
475
}
477
476
0 commit comments