Trait rustc_data_structures::graph::scc::Annotation

source ·
pub trait Annotation: Debug + Copy {
    // Required methods
    fn merge_scc(self, other: Self) -> Self;
    fn merge_reached(self, other: Self) -> Self;

    // Provided methods
    fn update_scc(&mut self, other: Self) { ... }
    fn update_reachable(&mut self, other: Self) { ... }
}
Expand description

An annotation for an SCC. This can be a representative, the max/min element of the SCC, or all of the above.

Concretely, the both merge operations must commute, e.g. where merge is merge_scc and merge_reached: a.merge(b) == b.merge(a)

In general, what you want is probably always min/max according to some ordering, potentially with side constraints (min x such that P holds).

Required Methods§

source

fn merge_scc(self, other: Self) -> Self

Merge two existing annotations into one during path compression.o

source

fn merge_reached(self, other: Self) -> Self

Merge a successor into this annotation.

Provided Methods§

source

fn update_scc(&mut self, other: Self)

source

fn update_reachable(&mut self, other: Self)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Annotation for ()

The empty annotation, which does nothing.

source§

fn merge_reached(self, _other: Self) -> Self

source§

fn merge_scc(self, _other: Self) -> Self

Implementors§