[−][src]Trait rustc_trait_selection::traits::TraitEngine

pub trait TraitEngine<'tcx>: 'tcx {
    pub fn normalize_projection_type(
        &mut self,
        infcx: &InferCtxt<'_, 'tcx>,
        param_env: ParamEnv<'tcx>,
        projection_ty: ProjectionTy<'tcx>,
        cause: ObligationCause<'tcx>
    ) -> &'tcx TyS<'tcx>;
pub fn register_predicate_obligation(
        &mut self,
        infcx: &InferCtxt<'_, 'tcx>,
        obligation: Obligation<'tcx, Predicate<'tcx>>
    );
pub fn select_all_or_error(
        &mut self,
        infcx: &InferCtxt<'_, 'tcx>
    ) -> Result<(), Vec<FulfillmentError<'tcx>>>;
pub fn select_where_possible(
        &mut self,
        infcx: &InferCtxt<'_, 'tcx>
    ) -> Result<(), Vec<FulfillmentError<'tcx>>>;
pub fn pending_obligations(&self) -> Vec<Obligation<'tcx, Predicate<'tcx>>>; pub fn register_bound(
        &mut self,
        infcx: &InferCtxt<'_, 'tcx>,
        param_env: ParamEnv<'tcx>,
        ty: &'tcx TyS<'tcx>,
        def_id: DefId,
        cause: ObligationCause<'tcx>
    ) { ... } }

Required methods

pub fn normalize_projection_type(
    &mut self,
    infcx: &InferCtxt<'_, 'tcx>,
    param_env: ParamEnv<'tcx>,
    projection_ty: ProjectionTy<'tcx>,
    cause: ObligationCause<'tcx>
) -> &'tcx TyS<'tcx>
[src]

pub fn register_predicate_obligation(
    &mut self,
    infcx: &InferCtxt<'_, 'tcx>,
    obligation: Obligation<'tcx, Predicate<'tcx>>
)
[src]

pub fn select_all_or_error(
    &mut self,
    infcx: &InferCtxt<'_, 'tcx>
) -> Result<(), Vec<FulfillmentError<'tcx>>>
[src]

pub fn select_where_possible(
    &mut self,
    infcx: &InferCtxt<'_, 'tcx>
) -> Result<(), Vec<FulfillmentError<'tcx>>>
[src]

pub fn pending_obligations(&self) -> Vec<Obligation<'tcx, Predicate<'tcx>>>[src]

Loading content...

Provided methods

pub fn register_bound(
    &mut self,
    infcx: &InferCtxt<'_, 'tcx>,
    param_env: ParamEnv<'tcx>,
    ty: &'tcx TyS<'tcx>,
    def_id: DefId,
    cause: ObligationCause<'tcx>
)
[src]

Requires that ty must implement the trait with def_id in the given environment. This trait must not have any type parameters (except for Self).

Loading content...

Trait Implementations

impl<'tcx> TraitEngineExt<'tcx> for dyn TraitEngine<'tcx>[src]

Implementors

impl<'tcx> TraitEngine<'tcx> for rustc_trait_selection::traits::ChalkFulfillmentContext<'tcx>[src]

impl<'tcx> TraitEngine<'tcx> for rustc_trait_selection::traits::FulfillmentContext<'tcx>[src]

pub fn normalize_projection_type(
    &mut self,
    infcx: &InferCtxt<'_, 'tcx>,
    param_env: ParamEnv<'tcx>,
    projection_ty: ProjectionTy<'tcx>,
    cause: ObligationCause<'tcx>
) -> Ty<'tcx>
[src]

"Normalize" a projection type <SomeType as SomeTrait>::X by creating a fresh type variable $0 as well as a projection predicate <SomeType as SomeTrait>::X == $0. When the inference engine runs, it will attempt to find an impl of SomeTrait or a where-clause that lets us unify $0 with something concrete. If this fails, we'll unify $0 with projection_ty again.

Loading content...