Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b43a297

Browse files
committedMar 15, 2025
Fix record_diagnostic
1 parent 9a847b1 commit b43a297

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_query_system/src/dep_graph

1 file changed

+6
-2
lines changed
 

‎compiler/rustc_query_system/src/dep_graph/graph.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,14 @@ impl<D: Deps> DepGraph<D> {
538538
#[inline]
539539
pub fn record_diagnostic<Qcx: QueryContext>(&self, qcx: Qcx, diagnostic: &DiagInner) {
540540
if let Some(ref data) = self.data {
541-
self.read_index(data.encode_diagnostic(qcx, diagnostic));
541+
D::read_deps(|task_deps| match task_deps {
542+
TaskDepsRef::EvalAlways | TaskDepsRef::Ignore => return,
543+
TaskDepsRef::Forbid | TaskDepsRef::Allow(..) => {
544+
self.read_index(data.encode_diagnostic(qcx, diagnostic));
545+
}
546+
})
542547
}
543548
}
544-
545549
/// This forces a diagnostic node green by running its side effect. `prev_index` would
546550
/// refer to a node created used `encode_diagnostic` in the previous session.
547551
#[inline]

0 commit comments

Comments
 (0)
Failed to load comments.