UnificationTable in rustc_data_structures::unify - Rust (original) (raw)

Struct UnificationTable

Source

pub struct UnificationTable<S>

where
    S: UnificationStoreBase,

{
    values: S,
}

Expand description

Table of unification keys and their values. You must define a key type K that implements the UnifyKey trait. Unification tables can be used in two-modes:

Source§

Source

Creates a UnificationTable using an external undo_log, allowing mutating methods to be called if L does not implement UndoLogs

Source§

Source

Source§

Source

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

Source

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

Source

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

Source

Returns the keys of all variables created since the snapshot.

Source§

Source

Returns the number of keys created so far.

Source§

Source

Creates a fresh key with the given value.

Source

Reserve memory for num_new_keys to be created. Does not actually create the new keys; you must then invoke new_key.

Source

Clears all unifications that have been performed, resetting to the initial state. The values of each variable are given by the closure.

Source§

//////////////////////////////////////////////////////////////////////// Public API

Source

Obtains current value for key without any pointer chasing; may return None if key has been union’d.

Source§

Source

Unions two keys without the possibility of failure; only applicable when unify values use NoError as their error type.

Source

Unions a key and a value without the possibility of failure; only applicable when unify values use NoError as their error type.

Source

Given two keys, indicates whether they have been unioned together.

Source

Given a key, returns the (current) root key.

Source

Unions together two variables, merging their values. If merging the values fails, the error is propagated and this method has no effect.

Source

Sets the value of the key a_id to b, attempting to merge with the previous value.

Source

Returns the current value for the given key. If the key has been union’d, this will give the value from the current root.

Source

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