@@ -579,12 +579,11 @@ impl<'hir> Map<'hir> {
579
579
580
580
/// Retrieves the `Node` corresponding to `id`, panicking if it cannot be found.
581
581
pub fn get ( & self , id : HirId ) -> Node < ' hir > {
582
- // read recorded by `find`
583
582
self . find ( id) . unwrap_or_else ( || bug ! ( "couldn't find hir id {} in the HIR map" , id) )
584
583
}
585
584
586
585
pub fn get_if_local ( & self , id : DefId ) -> Option < Node < ' hir > > {
587
- self . as_local_hir_id ( id) . map ( |id| self . get ( id) ) // read recorded by `get`
586
+ self . as_local_hir_id ( id) . map ( |id| self . get ( id) )
588
587
}
589
588
590
589
pub fn get_generics ( & self , id : DefId ) -> Option < & ' hir Generics < ' hir > > {
@@ -628,13 +627,7 @@ impl<'hir> Map<'hir> {
628
627
/// from a node to the root of the HIR (unless you get back the same ID here,
629
628
/// which can happen if the ID is not in the map itself or is just weird).
630
629
pub fn get_parent_node ( & self , hir_id : HirId ) -> HirId {
631
- if self . dep_graph . is_fully_enabled ( ) {
632
- let hir_id_owner = hir_id. owner ;
633
- let def_path_hash = self . definitions . def_path_hash ( hir_id_owner) ;
634
- self . dep_graph . read ( DepNode :: from_def_path_hash ( def_path_hash, DepKind :: HirBody ) ) ;
635
- }
636
-
637
- self . find_entry ( hir_id) . and_then ( |x| x. parent_node ( ) ) . unwrap_or ( hir_id)
630
+ self . get_entry ( hir_id) . parent_node ( ) . unwrap_or ( hir_id)
638
631
}
639
632
640
633
/// Returns an iterator for the nodes in the ancestor tree of the `current_id`
0 commit comments