@@ -347,7 +347,7 @@ impl<'hir> Map<'hir> {
347347 if variant_data. ctor_hir_id ( ) . is_none ( ) {
348348 return None ;
349349 }
350- let ctor_of = match self . find_by_hir_id ( self . get_parent_node_by_hir_id ( hir_id) ) {
350+ let ctor_of = match self . find_by_hir_id ( self . get_parent_node ( hir_id) ) {
351351 Some ( Node :: Item ( ..) ) => def:: CtorOf :: Struct ,
352352 Some ( Node :: Variant ( ..) ) => def:: CtorOf :: Variant ,
353353 _ => unreachable ! ( ) ,
@@ -424,7 +424,7 @@ impl<'hir> Map<'hir> {
424424 /// which this is the body of, i.e., a `fn`, `const` or `static`
425425 /// item (possibly associated), a closure, or a `hir::AnonConst`.
426426 pub fn body_owner ( & self , BodyId { hir_id } : BodyId ) -> HirId {
427- let parent = self . get_parent_node_by_hir_id ( hir_id) ;
427+ let parent = self . get_parent_node ( hir_id) ;
428428 assert ! ( self . lookup( parent) . map_or( false , |e| e. is_body_owner( hir_id) ) ) ;
429429 parent
430430 }
@@ -485,7 +485,7 @@ impl<'hir> Map<'hir> {
485485 match self . get ( id) {
486486 Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
487487 Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => id,
488- Node :: GenericParam ( _) => self . get_parent_node_by_hir_id ( id) ,
488+ Node :: GenericParam ( _) => self . get_parent_node ( id) ,
489489 _ => bug ! ( "ty_param_owner: {} not a type parameter" , self . node_to_string( id) )
490490 }
491491 }
@@ -625,7 +625,7 @@ impl<'hir> Map<'hir> {
625625 /// never appear as the parent node. Thus, you can always walk the parent nodes
626626 /// from a node to the root of the HIR (unless you get back the same ID here,
627627 /// which can happen if the ID is not in the map itself or is just weird).
628- pub fn get_parent_node_by_hir_id ( & self , hir_id : HirId ) -> HirId {
628+ pub fn get_parent_node ( & self , hir_id : HirId ) -> HirId {
629629 if self . dep_graph . is_fully_enabled ( ) {
630630 let hir_id_owner = hir_id. owner ;
631631 let def_path_hash = self . definitions . def_path_hash ( hir_id_owner) ;
@@ -644,7 +644,7 @@ impl<'hir> Map<'hir> {
644644 Some ( Node :: Binding ( _) ) => ( ) ,
645645 _ => return false ,
646646 }
647- match self . find_by_hir_id ( self . get_parent_node_by_hir_id ( id) ) {
647+ match self . find_by_hir_id ( self . get_parent_node ( id) ) {
648648 Some ( Node :: Item ( _) ) |
649649 Some ( Node :: TraitItem ( _) ) |
650650 Some ( Node :: ImplItem ( _) ) => true ,
@@ -680,7 +680,7 @@ impl<'hir> Map<'hir> {
680680 {
681681 let mut id = start_id;
682682 loop {
683- let parent_id = self . get_parent_node_by_hir_id ( id) ;
683+ let parent_id = self . get_parent_node ( id) ;
684684 if parent_id == CRATE_HIR_ID {
685685 return Ok ( CRATE_HIR_ID ) ;
686686 }
@@ -1022,7 +1022,7 @@ impl<'hir> Map<'hir> {
10221022 Some ( Node :: Arm ( arm) ) => arm. span ,
10231023 Some ( Node :: Block ( block) ) => block. span ,
10241024 Some ( Node :: Ctor ( ..) ) => match self . find_by_hir_id (
1025- self . get_parent_node_by_hir_id ( hir_id) )
1025+ self . get_parent_node ( hir_id) )
10261026 {
10271027 Some ( Node :: Item ( item) ) => item. span ,
10281028 Some ( Node :: Variant ( variant) ) => variant. span ,
0 commit comments