@@ -533,13 +533,17 @@ impl<D: Deps> DepGraph<D> {
533
533
}
534
534
}
535
535
536
+ /// This encodes a diagnostic by creating a node with an unique index and assoicating
537
+ /// `diagnostic` with it, for use in the next session.
536
538
#[ inline]
537
539
pub fn record_diagnostic < Qcx : QueryContext > ( & self , qcx : Qcx , diagnostic : & DiagInner ) {
538
540
if let Some ( ref data) = self . data {
539
541
self . read_index ( data. encode_diagnostic ( qcx, diagnostic) ) ;
540
542
}
541
543
}
542
544
545
+ /// This forces a diagnostic node green by running its side effect. `prev_index` would
546
+ /// refer to a node created used `encode_diagnostic` in the previous session.
543
547
#[ inline]
544
548
pub fn force_diagnostic_node < Qcx : QueryContext > (
545
549
& self ,
@@ -673,12 +677,15 @@ impl<D: Deps> DepGraphData<D> {
673
677
self . debug_loaded_from_disk . lock ( ) . insert ( dep_node) ;
674
678
}
675
679
680
+ /// This encodes a diagnostic by creating a node with an unique index and assoicating
681
+ /// `diagnostic` with it, for use in the next session.
676
682
#[ inline]
677
683
fn encode_diagnostic < Qcx : QueryContext > (
678
684
& self ,
679
685
qcx : Qcx ,
680
686
diagnostic : & DiagInner ,
681
687
) -> DepNodeIndex {
688
+ // Use `send` so we get an unique index, even though the dep node is not.
682
689
let dep_node_index = self . current . encoder . send (
683
690
DepNode {
684
691
kind : D :: DEP_KIND_SIDE_EFFECT ,
@@ -694,6 +701,8 @@ impl<D: Deps> DepGraphData<D> {
694
701
dep_node_index
695
702
}
696
703
704
+ /// This forces a diagnostic node green by running its side effect. `prev_index` would
705
+ /// refer to a node created used `encode_diagnostic` in the previous session.
697
706
#[ inline]
698
707
fn force_diagnostic_node < Qcx : QueryContext > (
699
708
& self ,
0 commit comments