Struct rustc_typeck::middle::traits::ObligationUnstable [-]  [+] [src]

pub struct Obligation<'tcx, T> {
    pub cause: ObligationCause<'tcx>,
    pub recursion_depth: usize,
    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> for Obligation<'tcx, O> where O: Repr<'tcx>

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

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

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

Derived Implementations

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

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

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