Trait rustc_typeck::middle::infer::unify::UnifyKeyUnstable [-]  [+] [src]

pub trait UnifyKey: PartialEq<Self> + Clone + Debug where <Self as UnifyKey>::Value: Sized, <Self as UnifyKey>::Value: UnifyValue {
    type Value;

    fn index(&self) -> usize;
    fn from_index(u: usize) -> Self;
    fn unification_table(infcx: &'v InferCtxt) -> &'v RefCell<UnificationTable<Self>>;
    fn tag(k: Option<Self>) -> &'static str;
}

This trait is implemented by any type that can serve as a type variable. We call such variables unification keys. For example, this trait is implemented by IntVid, which represents integral variables.

Each key type has an associated value type V. For example, for IntVid, this is Option<IntVarValue>, representing some (possibly not yet known) sort of integer.

Implementations of this trait are at the end of this file.

Associated Types

type Value

Required Methods

fn index(&self) -> usize

fn from_index(u: usize) -> Self

fn unification_table(infcx: &'v InferCtxt) -> &'v RefCell<UnificationTable<Self>>

fn tag(k: Option<Self>) -> &'static str

Implementors