Struct rustc::infer::type_variable::TypeVariableTable
[−]
[src]
pub struct TypeVariableTable<'tcx> { /* fields omitted */ }rustc_private)Methods
impl<'tcx> TypeVariableTable<'tcx>[src]
fn new() -> TypeVariableTable<'tcx>
rustc_private)fn default(&self, vid: TyVid) -> Option<Default<'tcx>>
rustc_private)fn var_diverges<'a>(&'a self, vid: TyVid) -> bool
rustc_private)fn var_origin(&self, vid: TyVid) -> &TypeVariableOrigin
rustc_private)fn relate_vars(&mut self, a: TyVid, dir: RelationDir, b: TyVid)
rustc_private)Records that a <: b, a :> b, or a == b, depending on dir.
Precondition: neither a nor b are known.
fn instantiate_and_push(&mut self,
vid: TyVid,
ty: Ty<'tcx>,
stack: &mut SmallVector<(Ty<'tcx>, RelationDir, TyVid)>)
vid: TyVid,
ty: Ty<'tcx>,
stack: &mut SmallVector<(Ty<'tcx>, RelationDir, TyVid)>)
rustc_private)Instantiates vid with the type ty and then pushes an entry onto stack for each of the
relations of vid to other variables. The relations will have the form (ty, dir, vid1)
where vid1 is some other variable id.
Precondition: vid must be a root in the unification table
fn new_var(&mut self,
diverging: bool,
origin: TypeVariableOrigin,
default: Option<Default<'tcx>>)
-> TyVid
diverging: bool,
origin: TypeVariableOrigin,
default: Option<Default<'tcx>>)
-> TyVid
rustc_private)fn num_vars(&self) -> usize
rustc_private)fn root_var(&mut self, vid: TyVid) -> TyVid
rustc_private)fn probe(&mut self, vid: TyVid) -> Option<Ty<'tcx>>
rustc_private)fn probe_root(&mut self, vid: TyVid) -> Option<Ty<'tcx>>
rustc_private)Retrieves the type of vid given that it is currently a root in the unification table
fn replace_if_possible(&mut self, t: Ty<'tcx>) -> Ty<'tcx>
rustc_private)fn snapshot(&mut self) -> Snapshot
rustc_private)fn rollback_to(&mut self, s: Snapshot)
rustc_private)fn commit(&mut self, s: Snapshot)
rustc_private)fn types_escaping_snapshot(&mut self, s: &Snapshot) -> Vec<Ty<'tcx>>
rustc_private)Find the set of type variables that existed before s
but which have only been unified since s started, and
return the types with which they were unified. So if we had
a type variable V0, then we started the snapshot, then we
created a type variable V1, unifed V0 with T0, and
unified V1 with T1, this function would return {T0}.
fn unsolved_variables(&mut self) -> Vec<TyVid>
rustc_private)