@@ -105,7 +105,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
105
105
hir_to_node_id : & ' a FxHashMap < HirId , NodeId > ,
106
106
mut hcx : StableHashingContext < ' a > )
107
107
-> NodeCollector < ' a , ' hir > {
108
- let root_mod_def_path_hash = definitions. def_path_hash ( CRATE_DEF_INDEX ) ;
108
+ let root_mod_def_path_hash = definitions. def_path_hash ( LocalDefId {
109
+ index : CRATE_DEF_INDEX ,
110
+ } ) ;
109
111
110
112
let mut hir_body_nodes = Vec :: new ( ) ;
111
113
@@ -254,9 +256,9 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
254
256
assert_eq ! ( self . definitions. node_to_hir_id( node_id) , hir_id) ;
255
257
256
258
if hir_id. owner != self . current_dep_node_owner {
257
- let node_str = match self . definitions . opt_def_index ( node_id) {
258
- Some ( def_index ) => {
259
- self . definitions . def_path ( def_index ) . to_string_no_crate ( )
259
+ let node_str = match self . definitions . opt_local_def_id ( node_id) {
260
+ Some ( def_id ) => {
261
+ self . definitions . def_path ( def_id ) . to_string_no_crate ( )
260
262
}
261
263
None => format ! ( "{:?}" , node)
262
264
} ;
@@ -274,10 +276,10 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
274
276
self . source_map. span_to_string( span) ,
275
277
node_str,
276
278
self . definitions
277
- . def_path( self . current_dep_node_owner. index )
279
+ . def_path( self . current_dep_node_owner)
278
280
. to_string_no_crate( ) ,
279
281
self . current_dep_node_owner,
280
- self . definitions. def_path( hir_id. owner. index ) . to_string_no_crate( ) ,
282
+ self . definitions. def_path( hir_id. owner) . to_string_no_crate( ) ,
281
283
hir_id. owner,
282
284
forgot_str,
283
285
)
@@ -308,7 +310,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
308
310
let prev_full_dep_index = self . current_full_dep_index ;
309
311
let prev_in_body = self . currently_in_body ;
310
312
311
- let def_path_hash = self . definitions . def_path_hash ( dep_node_owner. index ) ;
313
+ let def_path_hash = self . definitions . def_path_hash ( dep_node_owner) ;
312
314
313
315
let ( signature_dep_index, full_dep_index) = alloc_hir_dep_nodes (
314
316
self . dep_graph ,
@@ -369,8 +371,10 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
369
371
370
372
fn visit_item ( & mut self , i : & ' hir Item ) {
371
373
debug ! ( "visit_item: {:?}" , i) ;
372
- debug_assert_eq ! ( i. hir_id. owner. index,
373
- self . definitions. opt_def_index( self . hir_to_node_id[ & i. hir_id] ) . unwrap( ) ) ;
374
+ debug_assert_eq ! (
375
+ i. hir_id. owner,
376
+ self . definitions. opt_local_def_id( self . hir_to_node_id[ & i. hir_id] ) . unwrap( ) ,
377
+ ) ;
374
378
self . with_dep_node_owner ( i. hir_id . owner , i, |this| {
375
379
this. insert ( i. span , i. hir_id , Node :: Item ( i) ) ;
376
380
this. with_parent ( i. hir_id , |this| {
@@ -399,8 +403,10 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
399
403
}
400
404
401
405
fn visit_trait_item ( & mut self , ti : & ' hir TraitItem ) {
402
- debug_assert_eq ! ( ti. hir_id. owner. index,
403
- self . definitions. opt_def_index( self . hir_to_node_id[ & ti. hir_id] ) . unwrap( ) ) ;
406
+ debug_assert_eq ! (
407
+ ti. hir_id. owner,
408
+ self . definitions. opt_local_def_id( self . hir_to_node_id[ & ti. hir_id] ) . unwrap( ) ,
409
+ ) ;
404
410
self . with_dep_node_owner ( ti. hir_id . owner , ti, |this| {
405
411
this. insert ( ti. span , ti. hir_id , Node :: TraitItem ( ti) ) ;
406
412
@@ -411,8 +417,10 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
411
417
}
412
418
413
419
fn visit_impl_item ( & mut self , ii : & ' hir ImplItem ) {
414
- debug_assert_eq ! ( ii. hir_id. owner. index,
415
- self . definitions. opt_def_index( self . hir_to_node_id[ & ii. hir_id] ) . unwrap( ) ) ;
420
+ debug_assert_eq ! (
421
+ ii. hir_id. owner,
422
+ self . definitions. opt_local_def_id( self . hir_to_node_id[ & ii. hir_id] ) . unwrap( ) ,
423
+ ) ;
416
424
self . with_dep_node_owner ( ii. hir_id . owner , ii, |this| {
417
425
this. insert ( ii. span , ii. hir_id , Node :: ImplItem ( ii) ) ;
418
426
0 commit comments