@@ -523,7 +523,8 @@ where
523523 // We must ensure that this is handled correctly.
524524
525525 let ( prev_dep_node_index, dep_node_index) =
526- tcx. dep_context ( ) . dep_graph ( ) . try_mark_green_and_read ( tcx, & dep_node) ?;
526+ tcx. dep_context ( ) . dep_graph ( ) . try_mark_green ( tcx, & dep_node) ?;
527+ tcx. dep_context ( ) . dep_graph ( ) . read_index ( dep_node_index) ;
527528
528529 debug_assert ! ( tcx. dep_context( ) . dep_graph( ) . is_green( dep_node) ) ;
529530
@@ -725,9 +726,10 @@ where
725726
726727 let dep_node = query. to_dep_node ( * tcx. dep_context ( ) , key) ;
727728
728- match tcx. dep_context ( ) . dep_graph ( ) . try_mark_green_and_read ( tcx, & dep_node) {
729+ let dep_graph = tcx. dep_context ( ) . dep_graph ( ) ;
730+ match dep_graph. try_mark_green ( tcx, & dep_node) {
729731 None => {
730- // A None return from `try_mark_green_and_read ` means that this is either
732+ // A None return from `try_mark_green ` means that this is either
731733 // a new dep node or that the dep node has already been marked red.
732734 // Either way, we can't call `dep_graph.read()` as we don't have the
733735 // DepNodeIndex. We must invoke the query itself. The performance cost
@@ -736,6 +738,7 @@ where
736738 true
737739 }
738740 Some ( ( _, dep_node_index) ) => {
741+ dep_graph. read_index ( dep_node_index) ;
739742 tcx. dep_context ( ) . profiler ( ) . query_cache_hit ( dep_node_index. into ( ) ) ;
740743 false
741744 }
0 commit comments