@@ -224,6 +224,13 @@ impl DepGraph {
224224 with_deps ( TaskDepsRef :: Ignore , op)
225225 }
226226
227+ pub fn with_replay < OP , R > ( & self , op : OP ) -> R
228+ where
229+ OP : FnOnce ( ) -> R ,
230+ {
231+ with_deps ( TaskDepsRef :: Replay , op)
232+ }
233+
227234 /// Used to wrap the deserialization of a query result from disk,
228235 /// This method enforces that no new `DepNodes` are created during
229236 /// query result deserialization.
@@ -462,7 +469,7 @@ impl DepGraph {
462469 // queries. They are re-evaluated unconditionally anyway.
463470 return ;
464471 }
465- TaskDepsRef :: Ignore => return ,
472+ TaskDepsRef :: Ignore | TaskDepsRef :: Replay => return ,
466473 TaskDepsRef :: Forbid => {
467474 // Reading is forbidden in this context. ICE with a useful error message.
468475 panic_on_forbidden_read ( data, dep_node_index)
@@ -512,7 +519,7 @@ impl DepGraph {
512519 pub fn record_diagnostic < ' tcx > ( & self , tcx : TyCtxt < ' tcx > , diagnostic : & DiagInner ) {
513520 if let Some ( ref data) = self . data {
514521 read_deps ( |task_deps| match task_deps {
515- TaskDepsRef :: EvalAlways | TaskDepsRef :: Ignore => return ,
522+ TaskDepsRef :: EvalAlways | TaskDepsRef :: Ignore | TaskDepsRef :: Replay => return ,
516523 TaskDepsRef :: Forbid | TaskDepsRef :: Allow ( ..) => {
517524 let dep_node_index = data
518525 . encode_side_effect ( tcx, QuerySideEffect :: Diagnostic ( diagnostic. clone ( ) ) ) ;
@@ -606,7 +613,7 @@ impl DepGraph {
606613 TaskDepsRef :: EvalAlways => {
607614 edges. push ( DepNodeIndex :: FOREVER_RED_NODE ) ;
608615 }
609- TaskDepsRef :: Ignore => { }
616+ TaskDepsRef :: Ignore | TaskDepsRef :: Replay => { }
610617 TaskDepsRef :: Forbid => {
611618 panic ! ( "Cannot summarize when dependencies are not recorded." )
612619 }
@@ -1220,6 +1227,9 @@ pub enum TaskDepsRef<'a> {
12201227 EvalAlways ,
12211228 /// New dependencies are ignored. This is also used for `dep_graph.with_ignore`.
12221229 Ignore ,
1230+ /// This query has already been marked green, its dependency graph is recorded,
1231+ /// but we need to re-run the code to get its result.
1232+ Replay ,
12231233 /// Any attempt to add new dependencies will cause a panic.
12241234 /// This is used when decoding a query result from disk,
12251235 /// to ensure that the decoding process doesn't itself
0 commit comments