2
2
//! generate the actual methods on tcx which find and execute the provider,
3
3
//! manage the caches, and so forth.
4
4
5
- use crate :: dep_graph:: { DepKind , DepNode , DepNodeIndex , SerializedDepNodeIndex } ;
5
+ use crate :: dep_graph:: { DepNodeIndex , SerializedDepNodeIndex } ;
6
6
use crate :: ty:: query:: caches:: QueryCache ;
7
7
use crate :: ty:: query:: config:: { QueryContext , QueryDescription } ;
8
8
use crate :: ty:: query:: job:: { QueryInfo , QueryJob , QueryJobId , QueryJobInfo , QueryShardJobId } ;
@@ -17,6 +17,7 @@ use rustc_data_structures::sharded::Sharded;
17
17
use rustc_data_structures:: sync:: { Lock , LockGuard } ;
18
18
use rustc_data_structures:: thin_vec:: ThinVec ;
19
19
use rustc_errors:: { struct_span_err, Diagnostic , DiagnosticBuilder , FatalError , Handler , Level } ;
20
+ use rustc_query_system:: dep_graph:: { DepKind , DepNode } ;
20
21
use rustc_session:: Session ;
21
22
use rustc_span:: def_id:: DefId ;
22
23
use rustc_span:: source_map:: DUMMY_SP ;
@@ -102,7 +103,7 @@ impl<CTX: QueryContext, C: QueryCache<CTX>> QueryState<CTX, C> {
102
103
103
104
pub ( super ) fn try_collect_active_jobs (
104
105
& self ,
105
- kind : DepKind ,
106
+ kind : CTX :: DepKind ,
106
107
make_query : fn ( C :: Key ) -> CTX :: Query ,
107
108
jobs : & mut FxHashMap < QueryJobId < CTX :: DepKind > , QueryJobInfo < CTX > > ,
108
109
) -> Option < ( ) >
@@ -375,7 +376,7 @@ impl<'tcx> TyCtxt<'tcx> {
375
376
#[ inline( always) ]
376
377
fn start_query < F , R > (
377
378
self ,
378
- token : QueryJobId < DepKind > ,
379
+ token : QueryJobId < crate :: dep_graph :: DepKind > ,
379
380
diagnostics : Option < & Lock < ThinVec < Diagnostic > > > ,
380
381
compute : F ,
381
382
) -> R
@@ -570,7 +571,7 @@ impl<'tcx> TyCtxt<'tcx> {
570
571
// Fast path for when incr. comp. is off. `to_dep_node` is
571
572
// expensive for some `DepKind`s.
572
573
if !self . dep_graph . is_fully_enabled ( ) {
573
- let null_dep_node = DepNode :: new_no_params ( crate :: dep_graph :: DepKind :: Null ) ;
574
+ let null_dep_node = DepNode :: new_no_params ( DepKind :: NULL ) ;
574
575
return self . force_query_with_job :: < Q > ( key, job, null_dep_node) . 0 ;
575
576
}
576
577
@@ -634,7 +635,7 @@ impl<'tcx> TyCtxt<'tcx> {
634
635
key : Q :: Key ,
635
636
prev_dep_node_index : SerializedDepNodeIndex ,
636
637
dep_node_index : DepNodeIndex ,
637
- dep_node : & DepNode ,
638
+ dep_node : & DepNode < crate :: dep_graph :: DepKind > ,
638
639
) -> Q :: Value {
639
640
// Note this function can be called concurrently from the same query
640
641
// We must ensure that this is handled correctly.
@@ -689,7 +690,7 @@ impl<'tcx> TyCtxt<'tcx> {
689
690
fn incremental_verify_ich < Q : QueryDescription < TyCtxt < ' tcx > > > (
690
691
self ,
691
692
result : & Q :: Value ,
692
- dep_node : & DepNode ,
693
+ dep_node : & DepNode < crate :: dep_graph :: DepKind > ,
693
694
dep_node_index : DepNodeIndex ,
694
695
) {
695
696
use rustc_data_structures:: fingerprint:: Fingerprint ;
@@ -716,8 +717,8 @@ impl<'tcx> TyCtxt<'tcx> {
716
717
fn force_query_with_job < Q : QueryDescription < TyCtxt < ' tcx > > + ' tcx > (
717
718
self ,
718
719
key : Q :: Key ,
719
- job : JobOwner < ' tcx , TyCtxt < ' tcx > , Q :: Cache > ,
720
- dep_node : DepNode ,
720
+ job : JobOwner < ' tcx , Self , Q :: Cache > ,
721
+ dep_node : DepNode < crate :: dep_graph :: DepKind > ,
721
722
) -> ( Q :: Value , DepNodeIndex ) {
722
723
// If the following assertion triggers, it can have two reasons:
723
724
// 1. Something is wrong with DepNode creation, either here or
@@ -754,7 +755,7 @@ impl<'tcx> TyCtxt<'tcx> {
754
755
prof_timer. finish_with_query_invocation_id ( dep_node_index. into ( ) ) ;
755
756
756
757
if unlikely ! ( !diagnostics. is_empty( ) ) {
757
- if dep_node. kind != crate :: dep_graph :: DepKind :: Null {
758
+ if dep_node. kind != DepKind :: NULL {
758
759
self . queries . on_disk_cache . store_diagnostics ( dep_node_index, diagnostics) ;
759
760
}
760
761
}
@@ -803,7 +804,7 @@ impl<'tcx> TyCtxt<'tcx> {
803
804
self ,
804
805
key : Q :: Key ,
805
806
span : Span ,
806
- dep_node : DepNode ,
807
+ dep_node : DepNode < crate :: dep_graph :: DepKind > ,
807
808
) {
808
809
// We may be concurrently trying both execute and force a query.
809
810
// Ensure that only one of them runs the query.
0 commit comments