rustc_trait_selection::traits::query::type_op

Trait TypeOp

Source
pub trait TypeOp<'tcx>: Sized + Debug {
    type Output: Debug;
    type ErrorInfo;

    // Required method
    fn fully_perform(
        self,
        infcx: &InferCtxt<'tcx>,
        span: Span,
    ) -> Result<TypeOpOutput<'tcx, Self>, ErrorGuaranteed>;
}
Expand description

“Type ops” are used in NLL to perform some particular action and extract out the resulting region constraints (or an error if it cannot be completed).

Required Associated Types§

Required Methods§

Source

fn fully_perform( self, infcx: &InferCtxt<'tcx>, span: Span, ) -> Result<TypeOpOutput<'tcx, Self>, ErrorGuaranteed>

Processes the operation and all resulting obligations, returning the final result along with any region constraints (they will be given over to the NLL region solver).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'tcx, Q> TypeOp<'tcx> for ParamEnvAnd<'tcx, Q>
where Q: QueryTypeOp<'tcx>,

Source§

type Output = <Q as QueryTypeOp<'tcx>>::QueryResponse

Source§

type ErrorInfo = CanonicalQueryInput<TyCtxt<'tcx>, ParamEnvAnd<'tcx, Q>>

Source§

fn fully_perform( self, infcx: &InferCtxt<'tcx>, span: Span, ) -> Result<TypeOpOutput<'tcx, Self>, ErrorGuaranteed>

Implementors§

Source§

impl<'tcx, F, R> TypeOp<'tcx> for CustomTypeOp<F>
where F: FnOnce(&ObligationCtxt<'_, 'tcx>) -> Result<R, NoSolution>, R: Debug + TypeFoldable<TyCtxt<'tcx>>,