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

pub struct SelectionContext<'cx, 'tcx> {
    // some fields omitted
}

Methods

impl<'cx, 'tcx> SelectionContext<'cx, 'tcx>

fn new(infcx: &'cx InferCtxt<'cx, 'tcx>, param_env: &'cx ParameterEnvironment<'tcx>, typer: &'cx Typer<'tcx>) -> SelectionContext<'cx, 'tcx>

fn intercrate(infcx: &'cx InferCtxt<'cx, 'tcx>, param_env: &'cx ParameterEnvironment<'tcx>, typer: &'cx Typer<'tcx>) -> SelectionContext<'cx, 'tcx>

fn tcx(&self) -> &'cx ctxt<'tcx>

fn select(&mut self, obligation: &Obligation<'tcx>) -> Result<Option<Vtable<'tcx, Obligation<'tcx>>>, SelectionError<'tcx>>

Evaluates whether the obligation can be satisfied. Returns an indication of whether the obligation can be satisfied and, if so, by what means. Never affects surrounding typing environment.

fn select_inherent_impl(&mut self, impl_def_id: DefId, obligation_cause: ObligationCause<'tcx>, obligation_self_ty: &'tcx TyS<'tcx>) -> Result<Option<VtableImplData<'tcx, Obligation<'tcx>>>, SelectionError<'tcx>>

fn evaluate_obligation(&mut self, obligation: &Obligation<'tcx>) -> bool

Evaluates whether the obligation obligation can be satisfied (by any means).

fn evaluate_impl(&mut self, impl_def_id: DefId, obligation: &Obligation<'tcx>) -> bool

Evaluates whether the impl with id impl_def_id could be applied to the self type obligation_self_ty. This can be used either for trait or inherent impls.

fn evaluate_method_obligation(&mut self, rcvr_ty: &'tcx TyS<'tcx>, xform_self_ty: &'tcx TyS<'tcx>, obligation: &Obligation<'tcx>) -> MethodMatchResult

Determine whether a trait-method is applicable to a receiver of type rcvr_ty. Does not affect the inference state.

  • rcvr_ty -- type of the receiver
  • xform_self_ty -- transformed self type declared on the method, with Self to a fresh type variable
  • obligation -- a reference to the trait where the method is declared, with the input types on the trait replaced with fresh type variables

fn confirm_method_match(&mut self, rcvr_ty: &'tcx TyS<'tcx>, xform_self_ty: &'tcx TyS<'tcx>, obligation: &Obligation<'tcx>, data: MethodMatchedData)

Given the successful result of a method match, this function "confirms" the result, which basically repeats the various matching operations, but outside of any snapshot so that their effects are committed into the inference state.