File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
compiler/rustc_data_structures/src/graph/scc Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,20 @@ use tracing::{debug, instrument};
2020mod tests;
2121
2222/// An annotation for an SCC. This can be a representative,
23- /// or the max/min element of the SCC, or all of the above.
23+ /// the max/min element of the SCC, or all of the above.
24+ ///
25+ /// Concretely, the following properties must hold (where `merge`
26+ /// is `merge_scc` and `merge_reached`):
27+ /// - idempotency: `a.merge(a) = a`
28+ /// - commutativity: `a.merge(b) = b.merge(a)`
29+ ///
30+ /// This is rather limiting and precludes, for example, counting.
31+ /// In general, what you want is probably always min/max according
32+ /// to some ordering, potentially with side constraints (min x such
33+ /// that P holds).
2434pub trait Annotation : Debug + Copy {
2535 /// Merge two existing annotations into one during
26- /// path compression.
36+ /// path compression.o
2737 fn merge_scc ( self , other : Self ) -> Self ;
2838
2939 /// Merge a successor into this annotation.
You can’t perform that action at this time.
0 commit comments