@@ -582,11 +582,12 @@ impl<'tcx> TyCtxt<'tcx> {
582582 let marked = tcx. dep_graph . try_mark_green_and_read ( tcx, & dep_node) ;
583583 marked. map ( |( prev_dep_node_index, dep_node_index) | {
584584 (
585- tcx. load_from_disk_and_cache_in_memory :: < Q > (
585+ tcx. load_from_disk_and_cache_in_memory (
586586 key. clone ( ) ,
587587 prev_dep_node_index,
588588 dep_node_index,
589589 & dep_node,
590+ & Q :: reify ( ) ,
590591 ) ,
591592 dep_node_index,
592593 )
@@ -603,24 +604,25 @@ impl<'tcx> TyCtxt<'tcx> {
603604 result
604605 }
605606
606- fn load_from_disk_and_cache_in_memory < Q : QueryDescription < ' tcx > > (
607+ fn load_from_disk_and_cache_in_memory < K : Clone , V > (
607608 self ,
608- key : Q :: Key ,
609+ key : K ,
609610 prev_dep_node_index : SerializedDepNodeIndex ,
610611 dep_node_index : DepNodeIndex ,
611612 dep_node : & DepNode ,
612- ) -> Q :: Value {
613+ query : & QueryVtable < ' tcx , K , V > ,
614+ ) -> V {
613615 // Note this function can be called concurrently from the same query
614616 // We must ensure that this is handled correctly.
615617
616618 debug_assert ! ( self . dep_graph. is_green( dep_node) ) ;
617619
618620 // First we try to load the result from the on-disk cache.
619- let result = if Q :: cache_on_disk ( self , key. clone ( ) , None )
621+ let result = if query . cache_on_disk ( self , key. clone ( ) , None )
620622 && self . sess . opts . debugging_opts . incremental_queries
621623 {
622624 let prof_timer = self . prof . incr_cache_loading ( ) ;
623- let result = Q :: try_load_from_disk ( self , prev_dep_node_index) ;
625+ let result = query . try_load_from_disk ( self , prev_dep_node_index) ;
624626 prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
625627
626628 // We always expect to find a cached result for things that
@@ -644,7 +646,7 @@ impl<'tcx> TyCtxt<'tcx> {
644646 let prof_timer = self . prof . query_provider ( ) ;
645647
646648 // The dep-graph for this computation is already in-place.
647- let result = self . dep_graph . with_ignore ( || Q :: compute ( self , key) ) ;
649+ let result = self . dep_graph . with_ignore ( || query . compute ( self , key) ) ;
648650
649651 prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
650652
@@ -654,19 +656,20 @@ impl<'tcx> TyCtxt<'tcx> {
654656 // If `-Zincremental-verify-ich` is specified, re-hash results from
655657 // the cache and make sure that they have the expected fingerprint.
656658 if unlikely ! ( self . sess. opts. debugging_opts. incremental_verify_ich) {
657- self . incremental_verify_ich :: < Q > ( & result, dep_node, dep_node_index) ;
659+ self . incremental_verify_ich ( & result, dep_node, dep_node_index, query ) ;
658660 }
659661
660662 result
661663 }
662664
663665 #[ inline( never) ]
664666 #[ cold]
665- fn incremental_verify_ich < Q : QueryDescription < ' tcx > > (
667+ fn incremental_verify_ich < K , V > (
666668 self ,
667- result : & Q :: Value ,
669+ result : & V ,
668670 dep_node : & DepNode ,
669671 dep_node_index : DepNodeIndex ,
672+ query : & QueryVtable < ' tcx , K , V > ,
670673 ) {
671674 use crate :: ich:: Fingerprint ;
672675
@@ -680,7 +683,7 @@ impl<'tcx> TyCtxt<'tcx> {
680683 debug ! ( "BEGIN verify_ich({:?})" , dep_node) ;
681684 let mut hcx = self . create_stable_hashing_context ( ) ;
682685
683- let new_hash = Q :: hash_result ( & mut hcx, result) . unwrap_or ( Fingerprint :: ZERO ) ;
686+ let new_hash = query . hash_result ( & mut hcx, result) . unwrap_or ( Fingerprint :: ZERO ) ;
684687 debug ! ( "END verify_ich({:?})" , dep_node) ;
685688
686689 let old_hash = self . dep_graph . fingerprint_of ( dep_node_index) ;
0 commit comments