@@ -8,8 +8,8 @@ use rustc_data_structures::{defer, outline, sharded, sync};
88use rustc_errors:: FatalError ;
99use rustc_middle:: dep_graph:: { DepGraphData , DepNodeKey , SerializedDepNodeIndex } ;
1010use rustc_middle:: query:: {
11- ActiveKeyStatus , Cycle , EnsureMode , QueryCache , QueryJob , QueryJobId , QueryKey , QueryLatch ,
12- QueryMode , QueryState , QueryVTable ,
11+ ActiveKeyStatus , Cycle , QueryCache , QueryJob , QueryJobId , QueryKey , QueryLatch , QueryMode ,
12+ QueryState , QueryVTable ,
1313} ;
1414use rustc_middle:: ty:: TyCtxt ;
1515use rustc_middle:: verify_ich:: incremental_verify_ich;
@@ -19,7 +19,7 @@ use tracing::debug;
1919use crate :: dep_graph:: { DepNode , DepNodeIndex } ;
2020use crate :: handle_cycle_error;
2121use crate :: job:: { QueryJobInfo , QueryJobMap , create_cycle_error, find_cycle_in_stack} ;
22- use crate :: plumbing:: { current_query_job, loadable_from_disk , next_job_id, start_query} ;
22+ use crate :: plumbing:: { current_query_job, next_job_id, start_query} ;
2323use crate :: query_impl:: for_each_query_vtable;
2424
2525#[ inline]
@@ -564,7 +564,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
564564 value
565565}
566566
567- /// Checks whether a `tcx.ensure_ok()` or `tcx.ensure_done()` query call can
567+ /// Checks whether a `tcx.ensure_ok()` query call can
568568/// return early without actually trying to execute.
569569///
570570/// This only makes sense during incremental compilation, because it relies
@@ -574,9 +574,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
574574fn ensure_can_skip_execution < ' tcx , C : QueryCache > (
575575 query : & ' tcx QueryVTable < ' tcx , C > ,
576576 tcx : TyCtxt < ' tcx > ,
577- key : C :: Key ,
578577 dep_node : DepNode ,
579- ensure_mode : EnsureMode ,
580578) -> bool {
581579 // Queries with `eval_always` should never skip execution.
582580 if query. eval_always {
@@ -593,25 +591,15 @@ fn ensure_can_skip_execution<'tcx, C: QueryCache>(
593591 // in-memory cache, or another query down the line will.
594592 false
595593 }
596- Some ( ( serialized_dep_node_index , dep_node_index) ) => {
594+ Some ( ( _ , dep_node_index) ) => {
597595 tcx. dep_graph . read_index ( dep_node_index) ;
598596 tcx. prof . query_cache_hit ( dep_node_index. into ( ) ) ;
599- match ensure_mode {
600- // In ensure-ok mode, we can skip execution for this key if the
601- // node is green. It must have succeeded in the previous
602- // session, and therefore would succeed in the current session
603- // if executed.
604- EnsureMode :: Ok => true ,
605-
606- // In ensure-done mode, we can only skip execution for this key
607- // if there's a disk-cached value available to load later if
608- // needed, which guarantees the query provider will never run
609- // for this key.
610- EnsureMode :: Done => {
611- query. will_cache_on_disk_for_key ( key)
612- && loadable_from_disk ( tcx, serialized_dep_node_index)
613- }
614- }
597+
598+ // We can skip execution for this key if the
599+ // node is green. It must have succeeded in the previous
600+ // session, and therefore would succeed in the current session
601+ // if executed.
602+ true
615603 }
616604 }
617605}
@@ -640,9 +628,9 @@ pub(super) fn execute_query_incr_inner<'tcx, C: QueryCache>(
640628) -> Option < C :: Value > {
641629 let dep_node = DepNode :: construct ( tcx, query. dep_kind , & key) ;
642630
643- // Check if query execution can be skipped, for `ensure_ok` or `ensure_done` .
644- if let QueryMode :: Ensure { ensure_mode } = mode
645- && ensure_can_skip_execution ( query, tcx, key , dep_node, ensure_mode )
631+ // Check if query execution can be skipped, for `ensure_ok`.
632+ if let QueryMode :: EnsureOk = mode
633+ && ensure_can_skip_execution ( query, tcx, dep_node)
646634 {
647635 return None ;
648636 }
0 commit comments