Struct rustc::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: NodeId, 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, P: RegionEscape> RegionEscape for Obligation<'tcx, P>

fn has_regions_escaping_depth(&self, depth: u32) -> bool

fn has_escaping_regions(&self) -> bool

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

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

Derived Implementations

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

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

fn eq(&self, __arg_0: &Obligation<'tcx, T>) -> bool

fn ne(&self, __arg_0: &Obligation<'tcx, T>) -> bool

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

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

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