File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,12 @@ impl<'hir> Map<'hir> {
416
416
/// if the node is a body owner, otherwise returns `None`.
417
417
pub fn maybe_body_owned_by ( & self , id : NodeId ) -> Option < BodyId > {
418
418
if let Some ( entry) = self . find_entry ( id) {
419
+ if self . dep_graph . is_fully_enabled ( ) {
420
+ let hir_id_owner = self . node_to_hir_id ( id) . owner ;
421
+ let def_path_hash = self . definitions . def_path_hash ( hir_id_owner) ;
422
+ self . dep_graph . read ( def_path_hash. to_dep_node ( DepKind :: HirBody ) ) ;
423
+ }
424
+
419
425
if let Some ( body_id) = entry. associated_body ( ) {
420
426
// For item-like things and closures, the associated
421
427
// body has its own distinct id, and that is returned
@@ -530,6 +536,12 @@ impl<'hir> Map<'hir> {
530
536
/// from a node to the root of the ast (unless you get the same id back here
531
537
/// that can happen if the id is not in the map itself or is just weird).
532
538
pub fn get_parent_node ( & self , id : NodeId ) -> NodeId {
539
+ if self . dep_graph . is_fully_enabled ( ) {
540
+ let hir_id_owner = self . node_to_hir_id ( id) . owner ;
541
+ let def_path_hash = self . definitions . def_path_hash ( hir_id_owner) ;
542
+ self . dep_graph . read ( def_path_hash. to_dep_node ( DepKind :: HirBody ) ) ;
543
+ }
544
+
533
545
self . find_entry ( id) . and_then ( |x| x. parent_node ( ) ) . unwrap_or ( id)
534
546
}
535
547
You can’t perform that action at this time.
0 commit comments