Struct rustc::middle::infer::unify::UnificationTableUnstable [-]  [+] [src]

pub struct UnificationTable<K: UnifyKey> {
    // some fields omitted
}

Table of unification keys and their values.

Methods

impl<K: UnifyKey> UnificationTable<K>

fn new() -> UnificationTable<K>

fn snapshot(&mut self) -> Snapshot<K>

Starts a new snapshot. Each snapshot must be either rolled back or committed in a "LIFO" (stack) order.

fn rollback_to(&mut self, snapshot: Snapshot<K>)

Reverses all changes since the last snapshot. Also removes any keys that have been created since then.

fn commit(&mut self, snapshot: Snapshot<K>)

Commits all changes since the last snapshot. Of course, they can still be undone if there is a snapshot further out.

fn new_key(&mut self, value: Value) -> K

fn get(&mut self, tcx: &ctxt, vid: K) -> Node<K>

Find the root node for vid. This uses the standard union-find algorithm with path compression: http://en.wikipedia.org/wiki/Disjoint-set_data_structure

fn set<'tcx>(&mut self, _tcx: &ctxt<'tcx>, key: K, new_value: VarValue<K>)

Sets the value for vid to new_value. vid MUST be a root node! Also, we must be in the middle of a snapshot.

fn unify<'tcx>(&mut self, tcx: &ctxt<'tcx>, node_a: &Node<K>, node_b: &Node<K>) -> (K, usize)

Either redirects node_a to node_b or vice versa, depending on the relative rank. Returns the new root and rank. You should then update the value of the new root to something suitable.