@@ -129,15 +129,15 @@ fn mk_cycle<'tcx, C: QueryCache>(
129129 match query. cycle_error_handling {
130130 CycleErrorHandling :: Error => {
131131 let guar = error. emit ( ) ;
132- query. value_from_cycle_error ( tcx, cycle_error, guar)
132+ ( query. value_from_cycle_error ) ( tcx, cycle_error, guar)
133133 }
134134 CycleErrorHandling :: Fatal => {
135135 let guar = error. emit ( ) ;
136136 guar. raise_fatal ( ) ;
137137 }
138138 CycleErrorHandling :: DelayBug => {
139139 let guar = error. delay_as_bug ( ) ;
140- query. value_from_cycle_error ( tcx, cycle_error, guar)
140+ ( query. value_from_cycle_error ) ( tcx, cycle_error, guar)
141141 }
142142 CycleErrorHandling :: Stash => {
143143 let guar = if let Some ( root) = cycle_error. cycle . first ( )
@@ -147,7 +147,7 @@ fn mk_cycle<'tcx, C: QueryCache>(
147147 } else {
148148 error. emit ( )
149149 } ;
150- query. value_from_cycle_error ( tcx, cycle_error, guar)
150+ ( query. value_from_cycle_error ) ( tcx, cycle_error, guar)
151151 }
152152 }
153153}
@@ -453,7 +453,8 @@ fn execute_job_incr<'tcx, C: QueryCache>(
453453
454454 if !query. anon && !query. eval_always {
455455 // `to_dep_node` is expensive for some `DepKind`s.
456- let dep_node = dep_node_opt. get_or_insert_with ( || query. construct_dep_node ( tcx, & key) ) ;
456+ let dep_node =
457+ dep_node_opt. get_or_insert_with ( || DepNode :: construct ( tcx, query. dep_kind , & key) ) ;
457458
458459 // The diagnostics for this query will be promoted to the current session during
459460 // `try_mark_green()`, so we can ignore them here.
@@ -485,7 +486,8 @@ fn execute_job_incr<'tcx, C: QueryCache>(
485486 }
486487
487488 // `to_dep_node` is expensive for some `DepKind`s.
488- let dep_node = dep_node_opt. unwrap_or_else ( || query. construct_dep_node ( tcx, & key) ) ;
489+ let dep_node =
490+ dep_node_opt. unwrap_or_else ( || DepNode :: construct ( tcx, query. dep_kind , & key) ) ;
489491
490492 // Call the query provider.
491493 dep_graph_data. with_task (
@@ -522,7 +524,7 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
522524
523525 // First we try to load the result from the on-disk cache.
524526 // Some things are never cached on disk.
525- if let Some ( value) = query. try_load_from_disk ( tcx, key, prev_index, dep_node_index) {
527+ if let Some ( value) = ( query. try_load_from_disk_fn ) ( tcx, key, prev_index, dep_node_index) {
526528 if std:: intrinsics:: unlikely ( tcx. sess . opts . unstable_opts . query_dep_graph ) {
527529 dep_graph_data. mark_debug_loaded_from_disk ( * dep_node)
528530 }
@@ -555,15 +557,15 @@ fn load_from_disk_or_invoke_provider_green<'tcx, C: QueryCache>(
555557 // We always expect to find a cached result for things that
556558 // can be forced from `DepNode`.
557559 debug_assert ! (
558- !query. will_cache_on_disk_for_key ( tcx, key)
560+ !( query. will_cache_on_disk_for_key_fn ) ( tcx, key)
559561 || !tcx. key_fingerprint_style( dep_node. kind) . is_maybe_recoverable( ) ,
560562 "missing on-disk cache entry for {dep_node:?}"
561563 ) ;
562564
563565 // Sanity check for the logic in `ensure`: if the node is green and the result loadable,
564566 // we should actually be able to load it.
565567 debug_assert ! (
566- !query. is_loadable_from_disk ( tcx, key, prev_index) ,
568+ !( query. is_loadable_from_disk_fn ) ( tcx, key, prev_index) ,
567569 "missing on-disk cache entry for loadable {dep_node:?}"
568570 ) ;
569571
@@ -629,7 +631,7 @@ fn check_if_ensure_can_skip_execution<'tcx, C: QueryCache>(
629631 // Ensuring an anonymous query makes no sense
630632 assert ! ( !query. anon) ;
631633
632- let dep_node = query . construct_dep_node ( tcx, key) ;
634+ let dep_node = DepNode :: construct ( tcx, query . dep_kind , key) ;
633635
634636 let dep_graph = & tcx. dep_graph ;
635637 let serialized_dep_node_index = match dep_graph. try_mark_green ( tcx, & dep_node) {
@@ -660,7 +662,7 @@ fn check_if_ensure_can_skip_execution<'tcx, C: QueryCache>(
660662 // In ensure-done mode, we can only skip execution for this key if
661663 // there's a disk-cached value available to load later if needed,
662664 // which guarantees the query provider will never run for this key.
663- let is_loadable = query. is_loadable_from_disk ( tcx, key, serialized_dep_node_index) ;
665+ let is_loadable = ( query. is_loadable_from_disk_fn ) ( tcx, key, serialized_dep_node_index) ;
664666 EnsureCanSkip { skip_execution : is_loadable, dep_node : Some ( dep_node) }
665667 }
666668 }
0 commit comments