Struct rustc::middle::traits::ObligationExperimental [-]  [+] [src]

pub struct Obligation<'tcx> {
    pub cause: ObligationCause<'tcx>,
    pub recursion_depth: uint,
    pub trait_ref: Rc<TraitRef<'tcx>>,
}

An Obligation represents some trait reference (e.g. int:Eq) for which the vtable must be found. The process of finding a vtable is called "resolving" the Obligation. This process consists of either identifying an impl (e.g., impl Eq for int) that provides the required vtable, or else finding a bound that is in scope. The eventual result is usually a Selection (defined below).

Fields

cause
recursion_depth
trait_ref

Methods

impl<'tcx> Obligation<'tcx>

fn new(cause: ObligationCause<'tcx>, trait_ref: Rc<TraitRef<'tcx>>) -> Obligation<'tcx>

fn misc(span: Span, trait_ref: Rc<TraitRef<'tcx>>) -> Obligation<'tcx>

fn self_ty(&self) -> Ty<'tcx>

Trait Implementations

impl<'tcx> Repr<'tcx> for Obligation<'tcx>

fn repr(&self, tcx: &ctxt<'tcx>) -> String

impl<'tcx> TypeFoldable<'tcx> for Obligation<'tcx>

fn fold_with<F: TypeFolder<'tcx>>(&self, folder: &mut F) -> Obligation<'tcx>

Derived Implementations

impl<'tcx> Clone for Obligation<'tcx>

fn clone(&self) -> Obligation<'tcx>

fn clone_from(&mut self, source: &Self)