@@ -242,10 +242,8 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
242
242
// Make sure that the DepNode of some node coincides with the HirId
243
243
// owner of that node.
244
244
if cfg ! ( debug_assertions) {
245
- let node_id = self . definitions . hir_id_to_node_id ( hir_id) ;
246
-
247
245
if hir_id. owner != self . current_dep_node_owner {
248
- let node_str = match self . definitions . opt_local_def_id ( node_id ) {
246
+ let node_str = match self . definitions . opt_hir_id_to_local_def_id ( hir_id ) {
249
247
Some ( def_id) => self . definitions . def_path ( def_id) . to_string_no_crate ( ) ,
250
248
None => format ! ( "{:?}" , node) ,
251
249
} ;
@@ -335,9 +333,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
335
333
debug ! ( "visit_item: {:?}" , i) ;
336
334
debug_assert_eq ! (
337
335
i. hir_id. owner,
338
- self . definitions
339
- . opt_local_def_id( self . definitions. hir_id_to_node_id( i. hir_id) )
340
- . unwrap( )
336
+ self . definitions. opt_hir_id_to_local_def_id( i. hir_id) . unwrap( )
341
337
) ;
342
338
self . with_dep_node_owner ( i. hir_id . owner , i, |this, hash| {
343
339
this. insert_with_hash ( i. span , i. hir_id , Node :: Item ( i) , hash) ;
@@ -369,9 +365,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
369
365
fn visit_trait_item ( & mut self , ti : & ' hir TraitItem < ' hir > ) {
370
366
debug_assert_eq ! (
371
367
ti. hir_id. owner,
372
- self . definitions
373
- . opt_local_def_id( self . definitions. hir_id_to_node_id( ti. hir_id) )
374
- . unwrap( )
368
+ self . definitions. opt_hir_id_to_local_def_id( ti. hir_id) . unwrap( )
375
369
) ;
376
370
self . with_dep_node_owner ( ti. hir_id . owner , ti, |this, hash| {
377
371
this. insert_with_hash ( ti. span , ti. hir_id , Node :: TraitItem ( ti) , hash) ;
@@ -385,9 +379,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
385
379
fn visit_impl_item ( & mut self , ii : & ' hir ImplItem < ' hir > ) {
386
380
debug_assert_eq ! (
387
381
ii. hir_id. owner,
388
- self . definitions
389
- . opt_local_def_id( self . definitions. hir_id_to_node_id( ii. hir_id) )
390
- . unwrap( )
382
+ self . definitions. opt_hir_id_to_local_def_id( ii. hir_id) . unwrap( )
391
383
) ;
392
384
self . with_dep_node_owner ( ii. hir_id . owner , ii, |this, hash| {
393
385
this. insert_with_hash ( ii. span , ii. hir_id , Node :: ImplItem ( ii) , hash) ;
0 commit comments