@@ -60,9 +60,7 @@ impl<'tcx> HasDepContext for QueryCtxt<'tcx> {
6060 }
6161}
6262
63- impl < ' tcx > QueryContext for QueryCtxt < ' tcx > {
64- type QueryInfo = QueryStackDeferred < ' tcx > ;
65-
63+ impl < ' tcx > QueryContext < ' tcx > for QueryCtxt < ' tcx > {
6664 #[ inline]
6765 fn jobserver_proxy ( & self ) -> & Proxy {
6866 & self . tcx . jobserver_proxy
@@ -93,10 +91,7 @@ impl<'tcx> QueryContext for QueryCtxt<'tcx> {
9391 /// Prefer passing `false` to `require_complete` to avoid potential deadlocks,
9492 /// especially when called from within a deadlock handler, unless a
9593 /// complete map is needed and no deadlock is possible at this call site.
96- fn collect_active_jobs (
97- self ,
98- require_complete : bool ,
99- ) -> Result < QueryMap < QueryStackDeferred < ' tcx > > , QueryMap < QueryStackDeferred < ' tcx > > > {
94+ fn collect_active_jobs ( self , require_complete : bool ) -> Result < QueryMap < ' tcx > , QueryMap < ' tcx > > {
10095 let mut jobs = QueryMap :: default ( ) ;
10196 let mut complete = true ;
10297
@@ -322,7 +317,7 @@ macro_rules! should_ever_cache_on_disk {
322317 } ;
323318}
324319
325- fn create_query_frame_extra < ' tcx , K : Key + Copy + ' tcx > (
320+ fn mk_query_stack_frame_extra < ' tcx , K : Key + Copy + ' tcx > (
326321 ( tcx, key, kind, name, do_describe) : (
327322 TyCtxt < ' tcx > ,
328323 K ,
@@ -373,18 +368,16 @@ pub(crate) fn create_query_frame<
373368) -> QueryStackFrame < QueryStackDeferred < ' tcx > > {
374369 let def_id = key. key_as_def_id ( ) ;
375370
376- let hash = || {
377- tcx. with_stable_hashing_context ( |mut hcx| {
378- let mut hasher = StableHasher :: new ( ) ;
379- kind. as_usize ( ) . hash_stable ( & mut hcx, & mut hasher) ;
380- key. hash_stable ( & mut hcx, & mut hasher) ;
381- hasher. finish :: < Hash64 > ( )
382- } )
383- } ;
371+ let hash = tcx. with_stable_hashing_context ( |mut hcx| {
372+ let mut hasher = StableHasher :: new ( ) ;
373+ kind. as_usize ( ) . hash_stable ( & mut hcx, & mut hasher) ;
374+ key. hash_stable ( & mut hcx, & mut hasher) ;
375+ hasher. finish :: < Hash64 > ( )
376+ } ) ;
384377 let def_id_for_ty_in_cycle = key. def_id_for_ty_in_cycle ( ) ;
385378
386379 let info =
387- QueryStackDeferred :: new ( ( tcx, key, kind, name, do_describe) , create_query_frame_extra ) ;
380+ QueryStackDeferred :: new ( ( tcx, key, kind, name, do_describe) , mk_query_stack_frame_extra ) ;
388381
389382 QueryStackFrame :: new ( info, kind, hash, def_id, def_id_for_ty_in_cycle)
390383}
@@ -417,7 +410,7 @@ pub(crate) fn encode_query_results<'a, 'tcx, Q>(
417410}
418411
419412pub ( crate ) fn query_key_hash_verify < ' tcx > (
420- query : impl QueryDispatcher < Qcx = QueryCtxt < ' tcx > > ,
413+ query : impl QueryDispatcher < ' tcx , Qcx = QueryCtxt < ' tcx > > ,
421414 qcx : QueryCtxt < ' tcx > ,
422415) {
423416 let _timer = qcx. tcx . prof . generic_activity_with_arg ( "query_key_hash_verify_for" , query. name ( ) ) ;
@@ -445,7 +438,7 @@ pub(crate) fn query_key_hash_verify<'tcx>(
445438
446439fn try_load_from_on_disk_cache < ' tcx , Q > ( query : Q , tcx : TyCtxt < ' tcx > , dep_node : DepNode )
447440where
448- Q : QueryDispatcher < Qcx = QueryCtxt < ' tcx > > ,
441+ Q : QueryDispatcher < ' tcx , Qcx = QueryCtxt < ' tcx > > ,
449442{
450443 debug_assert ! ( tcx. dep_graph. is_green( & dep_node) ) ;
451444
@@ -491,7 +484,7 @@ where
491484
492485fn force_from_dep_node < ' tcx , Q > ( query : Q , tcx : TyCtxt < ' tcx > , dep_node : DepNode ) -> bool
493486where
494- Q : QueryDispatcher < Qcx = QueryCtxt < ' tcx > > ,
487+ Q : QueryDispatcher < ' tcx , Qcx = QueryCtxt < ' tcx > > ,
495488{
496489 // We must avoid ever having to call `force_from_dep_node()` for a
497490 // `DepNode::codegen_unit`:
@@ -734,14 +727,14 @@ macro_rules! define_queries {
734727 }
735728
736729 #[ inline( always) ]
737- fn restore_val( value: <Self :: Dispatcher as QueryDispatcher >:: Value ) -> Self :: UnerasedValue {
730+ fn restore_val( value: <Self :: Dispatcher as QueryDispatcher < ' tcx> >:: Value ) -> Self :: UnerasedValue {
738731 erase:: restore_val:: <queries:: $name:: Value <' tcx>>( value)
739732 }
740733 }
741734
742735 pub ( crate ) fn collect_active_jobs<' tcx>(
743736 tcx: TyCtxt <' tcx>,
744- qmap: & mut QueryMap <QueryStackDeferred < ' tcx> >,
737+ qmap: & mut QueryMap <' tcx>,
745738 require_complete: bool ,
746739 ) -> Option <( ) > {
747740 let make_query = |tcx, key| {
@@ -825,7 +818,7 @@ macro_rules! define_queries {
825818 // These arrays are used for iteration and can't be indexed by `DepKind`.
826819
827820 const COLLECT_ACTIVE_JOBS : & [
828- for <' tcx> fn ( TyCtxt <' tcx>, & mut QueryMap <QueryStackDeferred < ' tcx> >, bool ) -> Option <( ) >
821+ for <' tcx> fn ( TyCtxt <' tcx>, & mut QueryMap <' tcx>, bool ) -> Option <( ) >
829822 ] =
830823 & [ $( query_impl:: $name:: collect_active_jobs) ,* ] ;
831824
0 commit comments