11//! Query configuration and description traits.
22
3+ use crate :: dep_graph:: DepNode ;
34use crate :: dep_graph:: SerializedDepNodeIndex ;
4- use crate :: dep_graph:: { DepContext , DepGraph , DepNode } ;
55use crate :: query:: caches:: QueryCache ;
6- use crate :: query:: job:: { QueryJobId , QueryJobInfo } ;
76use crate :: query:: plumbing:: CycleError ;
8- use crate :: query:: QueryState ;
7+ use crate :: query:: { QueryContext , QueryState } ;
98use rustc_data_structures:: profiling:: ProfileCategory ;
109use rustc_span:: def_id:: DefId ;
1110
1211use 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 ;
1812use std:: borrow:: Cow ;
1913use std:: fmt:: Debug ;
2014use std:: hash:: Hash ;
@@ -29,36 +23,6 @@ pub trait QueryConfig<CTX> {
2923 type Value : Clone ;
3024}
3125
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-
6226pub trait QueryAccessors < CTX : QueryContext > : QueryConfig < CTX > {
6327 const ANON : bool ;
6428 const EVAL_ALWAYS : bool ;
0 commit comments