@@ -219,7 +219,7 @@ impl<'hir> Map<'hir> {
219219 }
220220
221221 pub fn def_path_from_hir_id ( & self , id : HirId ) -> Option < DefPath > {
222- self . opt_local_def_id_from_hir_id ( id) . map ( |def_id| {
222+ self . opt_local_def_id ( id) . map ( |def_id| {
223223 self . def_path ( def_id)
224224 } )
225225 }
@@ -230,32 +230,30 @@ impl<'hir> Map<'hir> {
230230 }
231231
232232 #[ inline]
233- pub fn local_def_id ( & self , node : NodeId ) -> DefId {
234- self . opt_local_def_id ( node) . unwrap_or_else ( || {
233+ pub fn local_def_id_from_node_id ( & self , node : NodeId ) -> DefId {
234+ self . opt_local_def_id_from_node_id ( node) . unwrap_or_else ( || {
235235 let hir_id = self . node_to_hir_id ( node) ;
236- bug ! ( "local_def_id : no entry for `{}`, which has a map of `{:?}`" ,
236+ bug ! ( "local_def_id_from_node_id : no entry for `{}`, which has a map of `{:?}`" ,
237237 node, self . find_entry( hir_id) )
238238 } )
239239 }
240240
241- // FIXME(@ljedrz): replace the `NodeId` variant.
242241 #[ inline]
243- pub fn local_def_id_from_hir_id ( & self , hir_id : HirId ) -> DefId {
244- self . opt_local_def_id_from_hir_id ( hir_id) . unwrap_or_else ( || {
245- bug ! ( "local_def_id_from_hir_id : no entry for `{:?}`, which has a map of `{:?}`" ,
242+ pub fn local_def_id ( & self , hir_id : HirId ) -> DefId {
243+ self . opt_local_def_id ( hir_id) . unwrap_or_else ( || {
244+ bug ! ( "local_def_id : no entry for `{:?}`, which has a map of `{:?}`" ,
246245 hir_id, self . find_entry( hir_id) )
247246 } )
248247 }
249248
250- // FIXME(@ljedrz): replace the `NodeId` variant.
251249 #[ inline]
252- pub fn opt_local_def_id_from_hir_id ( & self , hir_id : HirId ) -> Option < DefId > {
250+ pub fn opt_local_def_id ( & self , hir_id : HirId ) -> Option < DefId > {
253251 let node_id = self . hir_to_node_id ( hir_id) ;
254252 self . definitions . opt_local_def_id ( node_id)
255253 }
256254
257255 #[ inline]
258- pub fn opt_local_def_id ( & self , node : NodeId ) -> Option < DefId > {
256+ pub fn opt_local_def_id_from_node_id ( & self , node : NodeId ) -> Option < DefId > {
259257 self . definitions . opt_local_def_id ( node)
260258 }
261259
@@ -264,7 +262,6 @@ impl<'hir> Map<'hir> {
264262 self . definitions . as_local_node_id ( def_id)
265263 }
266264
267- // FIXME(@ljedrz): replace the `NodeId` variant.
268265 #[ inline]
269266 pub fn as_local_hir_id ( & self , def_id : DefId ) -> Option < HirId > {
270267 self . definitions . as_local_hir_id ( def_id)
@@ -429,7 +426,7 @@ impl<'hir> Map<'hir> {
429426 }
430427
431428 pub fn body_owner_def_id ( & self , id : BodyId ) -> DefId {
432- self . local_def_id_from_hir_id ( self . body_owner ( id) )
429+ self . local_def_id ( self . body_owner ( id) )
433430 }
434431
435432 /// Given a `HirId`, returns the `BodyId` associated with it,
@@ -765,7 +762,7 @@ impl<'hir> Map<'hir> {
765762 /// Returns the `DefId` of `id`'s nearest module parent, or `id` itself if no
766763 /// module parent is in this map.
767764 pub fn get_module_parent ( & self , id : HirId ) -> DefId {
768- self . local_def_id_from_hir_id ( self . get_module_parent_node ( id) )
765+ self . local_def_id ( self . get_module_parent_node ( id) )
769766 }
770767
771768 /// Returns the `HirId` of `id`'s nearest module parent, or `id` itself if no
@@ -841,7 +838,7 @@ impl<'hir> Map<'hir> {
841838 }
842839
843840 pub fn get_parent_did ( & self , id : HirId ) -> DefId {
844- self . local_def_id_from_hir_id ( self . get_parent_item ( id) )
841+ self . local_def_id ( self . get_parent_item ( id) )
845842 }
846843
847844 pub fn get_foreign_abi ( & self , hir_id : HirId ) -> Abi {
@@ -1247,7 +1244,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
12471244 // the user-friendly path, otherwise fall back to stringifying DefPath.
12481245 crate :: ty:: tls:: with_opt ( |tcx| {
12491246 if let Some ( tcx) = tcx {
1250- let def_id = map. local_def_id_from_hir_id ( id) ;
1247+ let def_id = map. local_def_id ( id) ;
12511248 tcx. def_path_str ( def_id)
12521249 } else if let Some ( path) = map. def_path_from_hir_id ( id) {
12531250 path. data . into_iter ( ) . map ( |elem| {
0 commit comments