@@ -242,10 +242,8 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
242242 // Make sure that the DepNode of some node coincides with the HirId
243243 // owner of that node.
244244 if cfg ! ( debug_assertions) {
245- let node_id = self . definitions . hir_id_to_node_id ( hir_id) ;
246-
247245 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 ) {
249247 Some ( def_id) => self . definitions . def_path ( def_id) . to_string_no_crate ( ) ,
250248 None => format ! ( "{:?}" , node) ,
251249 } ;
@@ -335,9 +333,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
335333 debug ! ( "visit_item: {:?}" , i) ;
336334 debug_assert_eq ! (
337335 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( )
341337 ) ;
342338 self . with_dep_node_owner ( i. hir_id . owner , i, |this, hash| {
343339 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> {
369365 fn visit_trait_item ( & mut self , ti : & ' hir TraitItem < ' hir > ) {
370366 debug_assert_eq ! (
371367 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( )
375369 ) ;
376370 self . with_dep_node_owner ( ti. hir_id . owner , ti, |this, hash| {
377371 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> {
385379 fn visit_impl_item ( & mut self , ii : & ' hir ImplItem < ' hir > ) {
386380 debug_assert_eq ! (
387381 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( )
391383 ) ;
392384 self . with_dep_node_owner ( ii. hir_id . owner , ii, |this, hash| {
393385 this. insert_with_hash ( ii. span , ii. hir_id , Node :: ImplItem ( ii) , hash) ;
0 commit comments