@@ -8,7 +8,6 @@ use rustc_errors::Diagnostic;
8
8
use rustc_hir:: def_id:: DefId ;
9
9
10
10
mod dep_node;
11
- mod safe;
12
11
13
12
pub ( crate ) use rustc_query_system:: dep_graph:: DepNodeParams ;
14
13
pub use rustc_query_system:: dep_graph:: {
@@ -17,8 +16,6 @@ pub use rustc_query_system::dep_graph::{
17
16
} ;
18
17
19
18
pub use dep_node:: { label_strs, DepConstructor , DepKind , DepNode , DepNodeExt } ;
20
- pub use safe:: AssertDepGraphSafe ;
21
- pub use safe:: DepGraphSafe ;
22
19
23
20
pub type DepGraph = rustc_query_system:: dep_graph:: DepGraph < DepKind > ;
24
21
pub type TaskDeps = rustc_query_system:: dep_graph:: TaskDeps < DepKind > ;
@@ -27,6 +24,8 @@ pub type PreviousDepGraph = rustc_query_system::dep_graph::PreviousDepGraph<DepK
27
24
pub type SerializedDepGraph = rustc_query_system:: dep_graph:: SerializedDepGraph < DepKind > ;
28
25
29
26
impl rustc_query_system:: dep_graph:: DepKind for DepKind {
27
+ const NULL : Self = DepKind :: Null ;
28
+
30
29
fn is_eval_always ( & self ) -> bool {
31
30
DepKind :: is_eval_always ( self )
32
31
}
@@ -82,6 +81,10 @@ impl rustc_query_system::dep_graph::DepKind for DepKind {
82
81
op ( icx. task_deps )
83
82
} )
84
83
}
84
+
85
+ fn can_reconstruct_query_key ( & self ) -> bool {
86
+ DepKind :: can_reconstruct_query_key ( self )
87
+ }
85
88
}
86
89
87
90
impl < ' tcx > DepContext for TyCtxt < ' tcx > {
@@ -92,6 +95,10 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {
92
95
TyCtxt :: create_stable_hashing_context ( * self )
93
96
}
94
97
98
+ fn debug_dep_tasks ( & self ) -> bool {
99
+ self . sess . opts . debugging_opts . dep_tasks
100
+ }
101
+
95
102
fn try_force_from_dep_node ( & self , dep_node : & DepNode ) -> bool {
96
103
// FIXME: This match is just a workaround for incremental bugs and should
97
104
// be removed. https://github.com/rust-lang/rust/issues/62649 is one such
@@ -160,6 +167,14 @@ impl<'tcx> DepContext for TyCtxt<'tcx> {
160
167
self . queries . on_disk_cache . store_diagnostics ( dep_node_index, diagnostics)
161
168
}
162
169
170
+ fn store_diagnostics_for_anon_node (
171
+ & self ,
172
+ dep_node_index : DepNodeIndex ,
173
+ diagnostics : ThinVec < Diagnostic > ,
174
+ ) {
175
+ self . queries . on_disk_cache . store_diagnostics_for_anon_node ( dep_node_index, diagnostics)
176
+ }
177
+
163
178
fn profiler ( & self ) -> & SelfProfilerRef {
164
179
& self . prof
165
180
}
@@ -169,23 +184,3 @@ fn def_id_corresponds_to_hir_dep_node(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
169
184
let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
170
185
def_id. index == hir_id. owner . local_def_index
171
186
}
172
-
173
- impl rustc_query_system:: HashStableContext for StableHashingContext < ' _ > {
174
- fn debug_dep_tasks ( & self ) -> bool {
175
- self . sess ( ) . opts . debugging_opts . dep_tasks
176
- }
177
- }
178
-
179
- impl rustc_query_system:: HashStableContextProvider < StableHashingContext < ' tcx > > for TyCtxt < ' tcx > {
180
- fn get_stable_hashing_context ( & self ) -> StableHashingContext < ' tcx > {
181
- self . create_stable_hashing_context ( )
182
- }
183
- }
184
-
185
- impl rustc_query_system:: HashStableContextProvider < StableHashingContext < ' a > >
186
- for StableHashingContext < ' a >
187
- {
188
- fn get_stable_hashing_context ( & self ) -> Self {
189
- self . clone ( )
190
- }
191
- }
0 commit comments