@@ -584,12 +584,11 @@ impl<'hir> Map<'hir> {
584
584
585
585
/// Retrieves the `Node` corresponding to `id`, panicking if it cannot be found.
586
586
pub fn get ( & self , id : HirId ) -> Node < ' hir > {
587
- // read recorded by `find`
588
587
self . find ( id) . unwrap_or_else ( || bug ! ( "couldn't find hir id {} in the HIR map" , id) )
589
588
}
590
589
591
590
pub fn get_if_local ( & self , id : DefId ) -> Option < Node < ' hir > > {
592
- self . as_local_hir_id ( id) . map ( |id| self . get ( id) ) // read recorded by `get`
591
+ self . as_local_hir_id ( id) . map ( |id| self . get ( id) )
593
592
}
594
593
595
594
pub fn get_generics ( & self , id : DefId ) -> Option < & ' hir Generics < ' hir > > {
@@ -633,13 +632,7 @@ impl<'hir> Map<'hir> {
633
632
/// from a node to the root of the HIR (unless you get back the same ID here,
634
633
/// which can happen if the ID is not in the map itself or is just weird).
635
634
pub fn get_parent_node ( & self , hir_id : HirId ) -> HirId {
636
- if self . dep_graph . is_fully_enabled ( ) {
637
- let hir_id_owner = hir_id. owner ;
638
- let def_path_hash = self . definitions . def_path_hash ( hir_id_owner) ;
639
- self . dep_graph . read ( DepNode :: from_def_path_hash ( def_path_hash, DepKind :: HirBody ) ) ;
640
- }
641
-
642
- self . find_entry ( hir_id) . and_then ( |x| x. parent_node ( ) ) . unwrap_or ( hir_id)
635
+ self . get_entry ( hir_id) . parent_node ( ) . unwrap_or ( hir_id)
643
636
}
644
637
645
638
/// Checks if the node is an argument. An argument is a local variable whose
0 commit comments