File tree 1 file changed +12
-2
lines changed
compiler/rustc_data_structures/src/graph/scc
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};
20
20
mod tests;
21
21
22
22
/// 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).
24
34
pub trait Annotation : Debug + Copy {
25
35
/// Merge two existing annotations into one during
26
- /// path compression.
36
+ /// path compression.o
27
37
fn merge_scc ( self , other : Self ) -> Self ;
28
38
29
39
/// Merge a successor into this annotation.
You can’t perform that action at this time.
0 commit comments