@@ -743,12 +743,7 @@ fn incremental_verify_ich_failed<Tcx>(
743743///
744744/// Note: The optimization is only available during incr. comp.
745745#[ inline( never) ]
746- fn ensure_must_run < Q , Qcx > (
747- query : Q ,
748- qcx : Qcx ,
749- key : & Q :: Key ,
750- check_cache : bool ,
751- ) -> ( bool , Option < DepNode > )
746+ fn ensure_must_run < Q , Qcx > ( query : Q , qcx : Qcx , key : & Q :: Key ) -> ( bool , Option < DepNode > )
752747where
753748 Q : QueryConfig < Qcx > ,
754749 Qcx : QueryContext ,
@@ -763,7 +758,7 @@ where
763758 let dep_node = query. construct_dep_node ( * qcx. dep_context ( ) , key) ;
764759
765760 let dep_graph = qcx. dep_context ( ) . dep_graph ( ) ;
766- let serialized_dep_node_index = match dep_graph. try_mark_green ( qcx, & dep_node) {
761+ match dep_graph. try_mark_green ( qcx, & dep_node) {
767762 None => {
768763 // A None return from `try_mark_green` means that this is either
769764 // a new dep node or that the dep node has already been marked red.
@@ -773,26 +768,17 @@ where
773768 // in-memory cache, or another query down the line will.
774769 return ( true , Some ( dep_node) ) ;
775770 }
776- Some ( ( serialized_dep_node_index, dep_node_index) ) => {
777- dep_graph. read_index ( dep_node_index) ;
778- qcx. dep_context ( ) . profiler ( ) . query_cache_hit ( dep_node_index. into ( ) ) ;
779- serialized_dep_node_index
780- }
771+ Some ( _) => { }
781772 } ;
782773
783774 // We do not need the value at all, so do not check the cache.
784- if !check_cache {
785- return ( false , None ) ;
786- }
787-
788- let loadable = query. loadable_from_disk ( qcx, key, serialized_dep_node_index) ;
789- ( !loadable, Some ( dep_node) )
775+ ( false , None )
790776}
791777
792778#[ derive( Debug ) ]
793779pub enum QueryMode {
794780 Get ,
795- Ensure { check_cache : bool } ,
781+ Ensure ,
796782}
797783
798784#[ inline( always) ]
@@ -820,19 +806,18 @@ where
820806{
821807 debug_assert ! ( qcx. dep_context( ) . dep_graph( ) . is_fully_enabled( ) ) ;
822808
823- let dep_node = if let QueryMode :: Ensure { check_cache } = mode {
824- let ( must_run, dep_node) = ensure_must_run ( query, qcx, & key, check_cache) ;
825- if !must_run {
826- return None ;
809+ match mode {
810+ QueryMode :: Ensure => {
811+ let ( must_run, _) = ensure_must_run ( query, qcx, & key) ;
812+ if !must_run {
813+ return None ;
814+ }
827815 }
828- dep_node
829- } else {
830- None
831- } ;
816+ QueryMode :: Get => { }
817+ }
832818
833- let ( result, dep_node_index) = ensure_sufficient_stack ( || {
834- try_execute_query :: < _ , _ , true > ( query, qcx, span, key, dep_node)
835- } ) ;
819+ let ( result, dep_node_index) =
820+ ensure_sufficient_stack ( || try_execute_query :: < _ , _ , true > ( query, qcx, span, key, None ) ) ;
836821 if let Some ( dep_node_index) = dep_node_index {
837822 qcx. dep_context ( ) . dep_graph ( ) . read_index ( dep_node_index)
838823 }
0 commit comments