@@ -8,8 +8,8 @@ use rustc_data_structures::{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;
@@ -18,7 +18,7 @@ use tracing::warn;
1818
1919use crate :: dep_graph:: { DepNode , DepNodeIndex } ;
2020use crate :: job:: { QueryJobInfo , QueryJobMap , create_cycle_error, find_cycle_in_stack} ;
21- use crate :: plumbing:: { current_query_job, loadable_from_disk , next_job_id, start_query} ;
21+ use crate :: plumbing:: { current_query_job, next_job_id, start_query} ;
2222use crate :: query_impl:: for_each_query_vtable;
2323
2424#[ inline]
@@ -532,7 +532,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
532532 value
533533}
534534
535- /// Checks whether a `tcx.ensure_ok()` or `tcx.ensure_done()` query call can
535+ /// Checks whether a `tcx.ensure_ok()` query call can
536536/// return early without actually trying to execute.
537537///
538538/// This only makes sense during incremental compilation, because it relies
@@ -542,9 +542,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
542542fn ensure_can_skip_execution < ' tcx , C : QueryCache > (
543543 query : & ' tcx QueryVTable < ' tcx , C > ,
544544 tcx : TyCtxt < ' tcx > ,
545- key : C :: Key ,
546545 dep_node : DepNode ,
547- ensure_mode : EnsureMode ,
548546) -> bool {
549547 // Queries with `eval_always` should never skip execution.
550548 if query. eval_always {
@@ -561,25 +559,15 @@ fn ensure_can_skip_execution<'tcx, C: QueryCache>(
561559 // in-memory cache, or another query down the line will.
562560 false
563561 }
564- Some ( ( serialized_dep_node_index , dep_node_index) ) => {
562+ Some ( ( _ , dep_node_index) ) => {
565563 tcx. dep_graph . read_index ( dep_node_index) ;
566564 tcx. prof . query_cache_hit ( dep_node_index. into ( ) ) ;
567- match ensure_mode {
568- // In ensure-ok mode, we can skip execution for this key if the
569- // node is green. It must have succeeded in the previous
570- // session, and therefore would succeed in the current session
571- // if executed.
572- EnsureMode :: Ok => true ,
573-
574- // In ensure-done mode, we can only skip execution for this key
575- // if there's a disk-cached value available to load later if
576- // needed, which guarantees the query provider will never run
577- // for this key.
578- EnsureMode :: Done => {
579- ( query. will_cache_on_disk_for_key_fn ) ( key)
580- && loadable_from_disk ( tcx, serialized_dep_node_index)
581- }
582- }
565+
566+ // We can skip execution for this key if the
567+ // node is green. It must have succeeded in the previous
568+ // session, and therefore would succeed in the current session
569+ // if executed.
570+ true
583571 }
584572 }
585573}
@@ -608,9 +596,9 @@ pub(super) fn execute_query_incr_inner<'tcx, C: QueryCache>(
608596) -> Option < C :: Value > {
609597 let dep_node = DepNode :: construct ( tcx, query. dep_kind , & key) ;
610598
611- // Check if query execution can be skipped, for `ensure_ok` or `ensure_done` .
612- if let QueryMode :: Ensure { ensure_mode } = mode
613- && ensure_can_skip_execution ( query, tcx, key , dep_node, ensure_mode )
599+ // Check if query execution can be skipped, for `ensure_ok`.
600+ if let QueryMode :: EnsureOk = mode
601+ && ensure_can_skip_execution ( query, tcx, dep_node)
614602 {
615603 return None ;
616604 }
0 commit comments