diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2025-03-14 18:55:02 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2025-03-14 18:55:02 +0100 |
| commit | 9a847b1ea59090d9633a8dca75510cbe91589c00 (patch) | |
| tree | afc7bd196371da0a7a98ce09fd1d0c195ab7cc34 | |
| parent | 453b51a65ab00939d2dce3de24ce38489b5c7eb6 (diff) | |
| download | rust-9a847b1ea59090d9633a8dca75510cbe91589c00.tar.gz rust-9a847b1ea59090d9633a8dca75510cbe91589c00.zip | |
Add comments
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/graph.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index dbc7f034a6e..985ca649034 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -533,6 +533,8 @@ impl<D: Deps> DepGraph<D> { } } + /// This encodes a diagnostic by creating a node with an unique index and assoicating + /// `diagnostic` with it, for use in the next session. #[inline] pub fn record_diagnostic<Qcx: QueryContext>(&self, qcx: Qcx, diagnostic: &DiagInner) { if let Some(ref data) = self.data { @@ -540,6 +542,8 @@ impl<D: Deps> DepGraph<D> { } } + /// This forces a diagnostic node green by running its side effect. `prev_index` would + /// refer to a node created used `encode_diagnostic` in the previous session. #[inline] pub fn force_diagnostic_node<Qcx: QueryContext>( &self, @@ -673,12 +677,15 @@ impl<D: Deps> DepGraphData<D> { self.debug_loaded_from_disk.lock().insert(dep_node); } + /// This encodes a diagnostic by creating a node with an unique index and assoicating + /// `diagnostic` with it, for use in the next session. #[inline] fn encode_diagnostic<Qcx: QueryContext>( &self, qcx: Qcx, diagnostic: &DiagInner, ) -> DepNodeIndex { + // Use `send` so we get an unique index, even though the dep node is not. let dep_node_index = self.current.encoder.send( DepNode { kind: D::DEP_KIND_SIDE_EFFECT, @@ -694,6 +701,8 @@ impl<D: Deps> DepGraphData<D> { dep_node_index } + /// This forces a diagnostic node green by running its side effect. `prev_index` would + /// refer to a node created used `encode_diagnostic` in the previous session. #[inline] fn force_diagnostic_node<Qcx: QueryContext>( &self, |
