99// except according to those terms.
1010
1111use dep_graph:: SerializedDepNodeIndex ;
12+ use dep_graph:: DepNode ;
1213use hir:: def_id:: { CrateNum , DefId , DefIndex } ;
1314use mir:: interpret:: { GlobalId } ;
1415use traits:: query:: { CanonicalPredicateGoal , CanonicalProjectionGoal , CanonicalTyGoal } ;
@@ -19,20 +20,31 @@ use ty::maps::Query;
1920use ty:: maps:: QueryMap ;
2021
2122use std:: hash:: Hash ;
23+ use std:: fmt:: Debug ;
2224use syntax_pos:: symbol:: InternedString ;
2325use rustc_data_structures:: sync:: Lock ;
26+ use rustc_data_structures:: stable_hasher:: HashStable ;
27+ use ich:: StableHashingContext ;
2428
2529/// Query configuration and description traits.
2630
2731pub trait QueryConfig < ' tcx > {
28- type Key : Eq + Hash + Clone ;
29- type Value : Clone ;
32+ const NAME : & ' static str ;
33+
34+ type Key : Eq + Hash + Clone + Debug ;
35+ type Value : Clone + for < ' a > HashStable < StableHashingContext < ' a > > ;
3036
3137 fn query ( key : Self :: Key ) -> Query < ' tcx > ;
3238 fn query_map < ' a > ( tcx : TyCtxt < ' a , ' tcx , ' _ > ) -> & ' a Lock < QueryMap < ' tcx , Self > > ;
39+
40+ fn to_dep_node ( tcx : TyCtxt < ' _ , ' tcx , ' _ > , key : & Self :: Key ) -> DepNode ;
41+
42+ fn compute ( tcx : TyCtxt < ' _ , ' tcx , ' _ > , key : Self :: Key ) -> Self :: Value ;
43+
44+ fn handle_cycle_error ( tcx : TyCtxt < ' _ , ' tcx , ' _ > ) -> Self :: Value ;
3345}
3446
35- pub ( super ) trait QueryDescription < ' tcx > : QueryConfig < ' tcx > {
47+ pub trait QueryDescription < ' tcx > : QueryConfig < ' tcx > {
3648 fn describe ( tcx : TyCtxt , key : Self :: Key ) -> String ;
3749
3850 #[ inline]
0 commit comments