Trait rustc_typeck::middle::ty_relate::TypeRelationUnstable
[-] [+]
[src]
pub trait TypeRelation<'a, 'tcx> { fn tcx(&self) -> &'a ctxt<'tcx>; fn tag(&self) -> &'static str; fn a_is_expected(&self) -> bool; fn relate_with_variance<T>(&mut self, variance: Variance, a: &T, b: &T) -> Result<T, type_err<'tcx>> where T: Relate<'a, 'tcx>; fn tys(&mut self, a: &'tcx TyS<'tcx>, b: &'tcx TyS<'tcx>) -> Result<&'tcx TyS<'tcx>, type_err<'tcx>>; fn regions(&mut self, a: Region, b: Region) -> Result<Region, type_err<'tcx>>; fn binders<T>(&mut self, a: &Binder<T>, b: &Binder<T>) -> Result<Binder<T>, type_err<'tcx>> where T: Relate<'a, 'tcx>; fn relate<T>(&mut self, a: &T, b: &T) -> Result<T, type_err<'tcx>> where T: Relate<'a, 'tcx> { ... } }
Required Methods
fn tcx(&self) -> &'a ctxt<'tcx>
fn tag(&self) -> &'static str
Returns a static string we can use for printouts.
fn a_is_expected(&self) -> bool
Returns true if the value a
is the "expected" type in the
relation. Just affects error messages.
fn relate_with_variance<T>(&mut self, variance: Variance, a: &T, b: &T) -> Result<T, type_err<'tcx>> where T: Relate<'a, 'tcx>
Switch variance for the purpose of relating a
and b
.
fn tys(&mut self, a: &'tcx TyS<'tcx>, b: &'tcx TyS<'tcx>) -> Result<&'tcx TyS<'tcx>, type_err<'tcx>>
fn regions(&mut self, a: Region, b: Region) -> Result<Region, type_err<'tcx>>
fn binders<T>(&mut self, a: &Binder<T>, b: &Binder<T>) -> Result<Binder<T>, type_err<'tcx>> where T: Relate<'a, 'tcx>
Provided Methods
fn relate<T>(&mut self, a: &T, b: &T) -> Result<T, type_err<'tcx>> where T: Relate<'a, 'tcx>
Generic relation routine suitable for most anything.
Implementors
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Bivariate<'a, 'tcx>
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Equate<'a, 'tcx>
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Glb<'a, 'tcx>
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Lub<'a, 'tcx>
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Sub<'a, 'tcx>
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Match<'a, 'tcx>