@@ -27,14 +27,14 @@ use rustc_middle::ty::{self, TyCtxt};
2727use rustc_query_system:: dep_graph:: { DepNodeParams , HasDepContext } ;
2828use rustc_query_system:: ich:: StableHashingContext ;
2929use rustc_query_system:: query:: {
30- QueryCache , QueryConfig , QueryContext , QueryJobId , QueryMap , QuerySideEffect ,
30+ QueryCache , QueryContext , QueryDispatcher , QueryJobId , QueryMap , QuerySideEffect ,
3131 QueryStackDeferred , QueryStackFrame , QueryStackFrameExtra , force_query,
3232} ;
3333use rustc_query_system:: { QueryOverflow , QueryOverflowNote } ;
3434use rustc_serialize:: { Decodable , Encodable } ;
3535use rustc_span:: def_id:: LOCAL_CRATE ;
3636
37- use crate :: QueryConfigRestored ;
37+ use crate :: QueryDispatcherUnerased ;
3838
3939/// Implements [`QueryContext`] for use by [`rustc_query_system`], since that
4040/// crate does not have direct access to [`TyCtxt`].
@@ -387,13 +387,13 @@ pub(crate) fn create_query_frame<
387387}
388388
389389pub ( crate ) fn encode_query_results < ' a , ' tcx , Q > (
390- query : Q :: Config ,
390+ query : Q :: Dispatcher ,
391391 qcx : QueryCtxt < ' tcx > ,
392392 encoder : & mut CacheEncoder < ' a , ' tcx > ,
393393 query_result_index : & mut EncodedDepNodeIndex ,
394394) where
395- Q : super :: QueryConfigRestored < ' tcx > ,
396- Q :: RestoredValue : Encodable < CacheEncoder < ' a , ' tcx > > ,
395+ Q : QueryDispatcherUnerased < ' tcx > ,
396+ Q :: UnerasedValue : Encodable < CacheEncoder < ' a , ' tcx > > ,
397397{
398398 let _timer = qcx. tcx . prof . generic_activity_with_arg ( "encode_query_results_for" , query. name ( ) ) ;
399399
@@ -408,13 +408,13 @@ pub(crate) fn encode_query_results<'a, 'tcx, Q>(
408408
409409 // Encode the type check tables with the `SerializedDepNodeIndex`
410410 // as tag.
411- encoder. encode_tagged ( dep_node, & Q :: restore ( * value) ) ;
411+ encoder. encode_tagged ( dep_node, & Q :: restore_val ( * value) ) ;
412412 }
413413 } ) ;
414414}
415415
416416pub ( crate ) fn query_key_hash_verify < ' tcx > (
417- query : impl QueryConfig < QueryCtxt < ' tcx > > ,
417+ query : impl QueryDispatcher < QueryCtxt < ' tcx > > ,
418418 qcx : QueryCtxt < ' tcx > ,
419419) {
420420 let _timer = qcx. tcx . prof . generic_activity_with_arg ( "query_key_hash_verify_for" , query. name ( ) ) ;
@@ -442,7 +442,7 @@ pub(crate) fn query_key_hash_verify<'tcx>(
442442
443443fn try_load_from_on_disk_cache < ' tcx , Q > ( query : Q , tcx : TyCtxt < ' tcx > , dep_node : DepNode )
444444where
445- Q : QueryConfig < QueryCtxt < ' tcx > > ,
445+ Q : QueryDispatcher < QueryCtxt < ' tcx > > ,
446446{
447447 debug_assert ! ( tcx. dep_graph. is_green( & dep_node) ) ;
448448
@@ -488,7 +488,7 @@ where
488488
489489fn force_from_dep_node < ' tcx , Q > ( query : Q , tcx : TyCtxt < ' tcx > , dep_node : DepNode ) -> bool
490490where
491- Q : QueryConfig < QueryCtxt < ' tcx > > ,
491+ Q : QueryDispatcher < QueryCtxt < ' tcx > > ,
492492{
493493 // We must avoid ever having to call `force_from_dep_node()` for a
494494 // `DepNode::codegen_unit`:
@@ -521,9 +521,10 @@ pub(crate) fn make_dep_kind_vtable_for_query<'tcx, Q>(
521521 is_eval_always : bool ,
522522) -> DepKindVTable < ' tcx >
523523where
524- Q : QueryConfigRestored < ' tcx > ,
524+ Q : QueryDispatcherUnerased < ' tcx > ,
525525{
526- let fingerprint_style = <Q :: Config as QueryConfig < QueryCtxt < ' tcx > > >:: Key :: fingerprint_style ( ) ;
526+ let fingerprint_style =
527+ <Q :: Dispatcher as QueryDispatcher < QueryCtxt < ' tcx > > >:: Key :: fingerprint_style ( ) ;
527528
528529 if is_anon || !fingerprint_style. reconstructible ( ) {
529530 return DepKindVTable {
@@ -541,10 +542,10 @@ where
541542 is_eval_always,
542543 fingerprint_style,
543544 force_from_dep_node : Some ( |tcx, dep_node, _| {
544- force_from_dep_node ( Q :: config ( tcx) , tcx, dep_node)
545+ force_from_dep_node ( Q :: query_dispatcher ( tcx) , tcx, dep_node)
545546 } ) ,
546547 try_load_from_on_disk_cache : Some ( |tcx, dep_node| {
547- try_load_from_on_disk_cache ( Q :: config ( tcx) , tcx, dep_node)
548+ try_load_from_on_disk_cache ( Q :: query_dispatcher ( tcx) , tcx, dep_node)
548549 } ) ,
549550 name : Q :: NAME ,
550551 }
@@ -613,7 +614,7 @@ macro_rules! define_queries {
613614 #[ cfg( debug_assertions) ]
614615 let _guard = tracing:: span!( tracing:: Level :: TRACE , stringify!( $name) , ?key) . entered( ) ;
615616 get_query_incr(
616- QueryType :: config ( tcx) ,
617+ QueryType :: query_dispatcher ( tcx) ,
617618 QueryCtxt :: new( tcx) ,
618619 span,
619620 key,
@@ -633,7 +634,7 @@ macro_rules! define_queries {
633634 __mode: QueryMode ,
634635 ) -> Option <Erase <queries:: $name:: Value <' tcx>>> {
635636 Some ( get_query_non_incr(
636- QueryType :: config ( tcx) ,
637+ QueryType :: query_dispatcher ( tcx) ,
637638 QueryCtxt :: new( tcx) ,
638639 span,
639640 key,
@@ -710,9 +711,9 @@ macro_rules! define_queries {
710711 data: PhantomData <& ' tcx ( ) >
711712 }
712713
713- impl <' tcx> QueryConfigRestored <' tcx> for QueryType <' tcx> {
714- type RestoredValue = queries:: $name:: Value <' tcx>;
715- type Config = DynamicConfig <
714+ impl <' tcx> QueryDispatcherUnerased <' tcx> for QueryType <' tcx> {
715+ type UnerasedValue = queries:: $name:: Value <' tcx>;
716+ type Dispatcher = SemiDynamicQueryDispatcher <
716717 ' tcx,
717718 queries:: $name:: Storage <' tcx>,
718719 { is_anon!( [ $( $modifiers) * ] ) } ,
@@ -723,14 +724,14 @@ macro_rules! define_queries {
723724 const NAME : & ' static & ' static str = & stringify!( $name) ;
724725
725726 #[ inline( always) ]
726- fn config ( tcx: TyCtxt <' tcx>) -> Self :: Config {
727- DynamicConfig {
727+ fn query_dispatcher ( tcx: TyCtxt <' tcx>) -> Self :: Dispatcher {
728+ SemiDynamicQueryDispatcher {
728729 vtable: & tcx. query_system. query_vtables. $name,
729730 }
730731 }
731732
732733 #[ inline( always) ]
733- fn restore ( value: <Self :: Config as QueryConfig <QueryCtxt <' tcx>>>:: Value ) -> Self :: RestoredValue {
734+ fn restore_val ( value: <Self :: Dispatcher as QueryDispatcher <QueryCtxt <' tcx>>>:: Value ) -> Self :: UnerasedValue {
734735 restore:: <queries:: $name:: Value <' tcx>>( value)
735736 }
736737 }
@@ -782,7 +783,7 @@ macro_rules! define_queries {
782783 query_result_index: & mut EncodedDepNodeIndex
783784 ) {
784785 $crate:: plumbing:: encode_query_results:: <query_impl:: $name:: QueryType <' tcx>>(
785- query_impl:: $name:: QueryType :: config ( tcx) ,
786+ query_impl:: $name:: QueryType :: query_dispatcher ( tcx) ,
786787 QueryCtxt :: new( tcx) ,
787788 encoder,
788789 query_result_index,
@@ -792,7 +793,7 @@ macro_rules! define_queries {
792793
793794 pub ( crate ) fn query_key_hash_verify<' tcx>( tcx: TyCtxt <' tcx>) {
794795 $crate:: plumbing:: query_key_hash_verify(
795- query_impl:: $name:: QueryType :: config ( tcx) ,
796+ query_impl:: $name:: QueryType :: query_dispatcher ( tcx) ,
796797 QueryCtxt :: new( tcx) ,
797798 )
798799 }
0 commit comments