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

pub struct Obligation<'tcx, T> {
    pub cause: ObligationCause<'tcx>,
    pub recursion_depth: uint,
    pub predicate: T,
}

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
predicate

Methods

impl<'tcx, O> Obligation<'tcx, O>

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

fn misc(span: Span, body_id: u32, trait_ref: O) -> Obligation<'tcx, O>

fn with<P>(&self, value: P) -> Obligation<'tcx, P>

Trait Implementations

impl<'tcx, O: Repr<'tcx>> Repr<'tcx> for Obligation<'tcx, O>

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

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

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

Derived Implementations

impl<'tcx, T: Clone> Clone for Obligation<'tcx, T>

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

fn clone_from(&mut self, &Obligation<'tcx, T>)