UnionFindEntry in rustc_data_structures::union_find - Rust (original) (raw)

Struct UnionFindEntry

Source

struct UnionFindEntry<Key> {
    parent: Key,
    rank: u32,
}

Transitively points towards the “root” of the set containing this key.

Invariant: A root key is its own parent.

When merging two “root” keys, their ranks determine which key becomes the new root, to prevent the parent tree from becoming unnecessarily tall. See UnionFind::unify for details.

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.