@@ -28,7 +28,6 @@ pub(crate) struct QueryVtable<CTX: QueryContext, K, V> {
28
28
pub anon : bool ,
29
29
pub dep_kind : CTX :: DepKind ,
30
30
pub eval_always : bool ,
31
- pub to_dep_node : fn ( CTX , & K ) -> DepNode < CTX :: DepKind > ,
32
31
33
32
// Don't use this method to compute query results, instead use the methods on TyCtxt
34
33
pub compute : fn ( CTX , K ) -> V ,
@@ -40,8 +39,11 @@ pub(crate) struct QueryVtable<CTX: QueryContext, K, V> {
40
39
}
41
40
42
41
impl < CTX : QueryContext , K , V > QueryVtable < CTX , K , V > {
43
- pub ( crate ) fn to_dep_node ( & self , tcx : CTX , key : & K ) -> DepNode < CTX :: DepKind > {
44
- ( self . to_dep_node ) ( tcx, key)
42
+ pub ( crate ) fn to_dep_node ( & self , tcx : CTX , key : & K ) -> DepNode < CTX :: DepKind >
43
+ where
44
+ K : crate :: dep_graph:: DepNodeParams < CTX > ,
45
+ {
46
+ DepNode :: construct ( tcx, self . dep_kind , key)
45
47
}
46
48
47
49
pub ( crate ) fn compute ( & self , tcx : CTX , key : K ) -> V {
@@ -79,7 +81,12 @@ pub trait QueryAccessors<CTX: QueryContext>: QueryConfig<CTX> {
79
81
// Don't use this method to access query results, instead use the methods on TyCtxt
80
82
fn query_state < ' a > ( tcx : CTX ) -> & ' a QueryState < CTX , Self :: Cache > ;
81
83
82
- fn to_dep_node ( tcx : CTX , key : & Self :: Key ) -> DepNode < CTX :: DepKind > ;
84
+ fn to_dep_node ( tcx : CTX , key : & Self :: Key ) -> DepNode < CTX :: DepKind >
85
+ where
86
+ Self :: Key : crate :: dep_graph:: DepNodeParams < CTX > ,
87
+ {
88
+ DepNode :: construct ( tcx, Self :: DEP_KIND , key)
89
+ }
83
90
84
91
// Don't use this method to compute query results, instead use the methods on TyCtxt
85
92
fn compute ( tcx : CTX , key : Self :: Key ) -> Self :: Value ;
@@ -117,7 +124,6 @@ where
117
124
const VTABLE : QueryVtable < CTX , Q :: Key , Q :: Value > = QueryVtable {
118
125
anon : Q :: ANON ,
119
126
dep_kind : Q :: DEP_KIND ,
120
- to_dep_node : Q :: to_dep_node,
121
127
eval_always : Q :: EVAL_ALWAYS ,
122
128
compute : Q :: compute,
123
129
hash_result : Q :: hash_result,
0 commit comments