@@ -435,7 +435,7 @@ impl<'hir> Map<'hir> {
435435
436436 /// Given a `HirId`, returns the `BodyId` associated with it,
437437 /// if the node is a body owner, otherwise returns `None`.
438- pub fn maybe_body_owned_by_by_hir_id ( & self , hir_id : HirId ) -> Option < BodyId > {
438+ pub fn maybe_body_owned_by ( & self , hir_id : HirId ) -> Option < BodyId > {
439439 if let Some ( entry) = self . find_entry ( hir_id) {
440440 if self . dep_graph . is_fully_enabled ( ) {
441441 let hir_id_owner = hir_id. owner ;
@@ -451,13 +451,13 @@ impl<'hir> Map<'hir> {
451451
452452 /// Given a body owner's id, returns the `BodyId` associated with it.
453453 pub fn body_owned_by ( & self , id : HirId ) -> BodyId {
454- self . maybe_body_owned_by_by_hir_id ( id) . unwrap_or_else ( || {
455- span_bug ! ( self . span_by_hir_id ( id) , "body_owned_by: {} has no associated body" ,
454+ self . maybe_body_owned_by ( id) . unwrap_or_else ( || {
455+ span_bug ! ( self . span ( id) , "body_owned_by: {} has no associated body" ,
456456 self . hir_to_string( id) ) ;
457457 } )
458458 }
459459
460- pub fn body_owner_kind_by_hir_id ( & self , id : HirId ) -> BodyOwnerKind {
460+ pub fn body_owner_kind ( & self , id : HirId ) -> BodyOwnerKind {
461461 match self . get_by_hir_id ( id) {
462462 Node :: Item ( & Item { node : ItemKind :: Const ( ..) , .. } ) |
463463 Node :: TraitItem ( & TraitItem { node : TraitItemKind :: Const ( ..) , .. } ) |
@@ -548,7 +548,7 @@ impl<'hir> Map<'hir> {
548548 let module = & self . forest . krate . modules [ & node_id] ;
549549
550550 for id in & module. items {
551- visitor. visit_item ( self . expect_item_by_hir_id ( * id) ) ;
551+ visitor. visit_item ( self . expect_item ( * id) ) ;
552552 }
553553
554554 for id in & module. trait_items {
@@ -784,7 +784,7 @@ impl<'hir> Map<'hir> {
784784
785785 /// Returns the `DefId` of `id`'s nearest module parent, or `id` itself if no
786786 /// module parent is in this map.
787- pub fn get_module_parent_by_hir_id ( & self , id : HirId ) -> DefId {
787+ pub fn get_module_parent ( & self , id : HirId ) -> DefId {
788788 self . local_def_id_from_hir_id ( self . get_module_parent_node ( id) )
789789 }
790790
@@ -860,11 +860,11 @@ impl<'hir> Map<'hir> {
860860 Some ( scope)
861861 }
862862
863- pub fn get_parent_did_by_hir_id ( & self , id : HirId ) -> DefId {
863+ pub fn get_parent_did ( & self , id : HirId ) -> DefId {
864864 self . local_def_id_from_hir_id ( self . get_parent_item ( id) )
865865 }
866866
867- pub fn get_foreign_abi_by_hir_id ( & self , hir_id : HirId ) -> Abi {
867+ pub fn get_foreign_abi ( & self , hir_id : HirId ) -> Abi {
868868 let parent = self . get_parent_item ( hir_id) ;
869869 if let Some ( entry) = self . find_entry ( parent) {
870870 if let Entry {
@@ -877,7 +877,7 @@ impl<'hir> Map<'hir> {
877877 bug ! ( "expected foreign mod or inlined parent, found {}" , self . hir_to_string( parent) )
878878 }
879879
880- pub fn expect_item_by_hir_id ( & self , id : HirId ) -> & ' hir Item {
880+ pub fn expect_item ( & self , id : HirId ) -> & ' hir Item {
881881 match self . find_by_hir_id ( id) { // read recorded by `find`
882882 Some ( Node :: Item ( item) ) => item,
883883 _ => bug ! ( "expected item, found {}" , self . hir_to_string( id) )
@@ -965,7 +965,7 @@ impl<'hir> Map<'hir> {
965965
966966 /// Given a node ID, gets a list of attributes associated with the AST
967967 /// corresponding to the node-ID.
968- pub fn attrs_by_hir_id ( & self , id : HirId ) -> & ' hir [ ast:: Attribute ] {
968+ pub fn attrs ( & self , id : HirId ) -> & ' hir [ ast:: Attribute ] {
969969 self . read ( id) ; // reveals attributes on the node
970970 let attrs = match self . find_entry ( id) . map ( |entry| entry. node ) {
971971 Some ( Node :: Local ( l) ) => Some ( & l. attrs [ ..] ) ,
@@ -981,7 +981,7 @@ impl<'hir> Map<'hir> {
981981 Some ( Node :: GenericParam ( param) ) => Some ( & param. attrs [ ..] ) ,
982982 // Unit/tuple structs/variants take the attributes straight from
983983 // the struct/variant definition.
984- Some ( Node :: Ctor ( ..) ) => return self . attrs_by_hir_id ( self . get_parent_item ( id) ) ,
984+ Some ( Node :: Ctor ( ..) ) => return self . attrs ( self . get_parent_item ( id) ) ,
985985 Some ( Node :: Crate ) => Some ( & self . forest . krate . attrs [ ..] ) ,
986986 _ => None
987987 } ;
@@ -1028,7 +1028,7 @@ impl<'hir> Map<'hir> {
10281028 } )
10291029 }
10301030
1031- pub fn span_by_hir_id ( & self , hir_id : HirId ) -> Span {
1031+ pub fn span ( & self , hir_id : HirId ) -> Span {
10321032 self . read ( hir_id) ; // reveals span from node
10331033 match self . find_entry ( hir_id) . map ( |entry| entry. node ) {
10341034 Some ( Node :: Item ( item) ) => item. span ,
@@ -1068,7 +1068,7 @@ impl<'hir> Map<'hir> {
10681068 }
10691069
10701070 pub fn span_if_local ( & self , id : DefId ) -> Option < Span > {
1071- self . as_local_hir_id ( id) . map ( |id| self . span_by_hir_id ( id) )
1071+ self . as_local_hir_id ( id) . map ( |id| self . span ( id) )
10721072 }
10731073
10741074 pub fn hir_to_string ( & self , id : HirId ) -> String {
@@ -1221,7 +1221,7 @@ pub fn map_crate<'hir>(sess: &crate::session::Session,
12211221impl < ' hir > print:: PpAnn for Map < ' hir > {
12221222 fn nested ( & self , state : & mut print:: State < ' _ > , nested : print:: Nested ) -> io:: Result < ( ) > {
12231223 match nested {
1224- Nested :: Item ( id) => state. print_item ( self . expect_item_by_hir_id ( id. id ) ) ,
1224+ Nested :: Item ( id) => state. print_item ( self . expect_item ( id. id ) ) ,
12251225 Nested :: TraitItem ( id) => state. print_trait_item ( self . trait_item ( id) ) ,
12261226 Nested :: ImplItem ( id) => state. print_impl_item ( self . impl_item ( id) ) ,
12271227 Nested :: Body ( id) => state. print_expr ( & self . body ( id) . value ) ,
0 commit comments