1
1
//! Query configuration and description traits.
2
2
3
+ use crate :: dep_graph:: DepNode ;
3
4
use crate :: dep_graph:: SerializedDepNodeIndex ;
4
- use crate :: dep_graph:: { DepContext , DepGraph , DepNode } ;
5
5
use crate :: query:: caches:: QueryCache ;
6
- use crate :: query:: job:: { QueryJobId , QueryJobInfo } ;
7
6
use crate :: query:: plumbing:: CycleError ;
8
- use crate :: query:: QueryState ;
7
+ use crate :: query:: { QueryContext , QueryState } ;
9
8
use rustc_data_structures:: profiling:: ProfileCategory ;
10
9
use rustc_span:: def_id:: DefId ;
11
10
12
11
use rustc_data_structures:: fingerprint:: Fingerprint ;
13
- use rustc_data_structures:: fx:: FxHashMap ;
14
- use rustc_data_structures:: stable_hasher:: HashStable ;
15
- use rustc_data_structures:: sync:: Lock ;
16
- use rustc_data_structures:: thin_vec:: ThinVec ;
17
- use rustc_errors:: Diagnostic ;
18
12
use std:: borrow:: Cow ;
19
13
use std:: fmt:: Debug ;
20
14
use std:: hash:: Hash ;
@@ -29,36 +23,6 @@ pub trait QueryConfig<CTX> {
29
23
type Value : Clone ;
30
24
}
31
25
32
- pub trait QueryContext : DepContext {
33
- type Query : Clone + HashStable < Self :: StableHashingContext > ;
34
-
35
- fn incremental_verify_ich ( & self ) -> bool ;
36
- fn verbose ( & self ) -> bool ;
37
-
38
- /// Get string representation from DefPath.
39
- fn def_path_str ( & self , def_id : DefId ) -> String ;
40
-
41
- /// Access the DepGraph.
42
- fn dep_graph ( & self ) -> & DepGraph < Self :: DepKind > ;
43
-
44
- /// Get the query information from the TLS context.
45
- fn current_query_job ( & self ) -> Option < QueryJobId < Self :: DepKind > > ;
46
-
47
- fn try_collect_active_jobs (
48
- & self ,
49
- ) -> Option < FxHashMap < QueryJobId < Self :: DepKind > , QueryJobInfo < Self > > > ;
50
-
51
- /// Executes a job by changing the `ImplicitCtxt` to point to the
52
- /// new query job while it executes. It returns the diagnostics
53
- /// captured during execution and the actual result.
54
- fn start_query < R > (
55
- & self ,
56
- token : QueryJobId < Self :: DepKind > ,
57
- diagnostics : Option < & Lock < ThinVec < Diagnostic > > > ,
58
- compute : impl FnOnce ( Self ) -> R ,
59
- ) -> R ;
60
- }
61
-
62
26
pub trait QueryAccessors < CTX : QueryContext > : QueryConfig < CTX > {
63
27
const ANON : bool ;
64
28
const EVAL_ALWAYS : bool ;
0 commit comments