Skip to main content

TypeOpInfo

Trait TypeOpInfo 

Source
pub(crate) trait TypeOpInfo<'tcx> {
    // Required methods
    fn fallback_error(&self, tcx: TyCtxt<'tcx>, span: Span) -> Diag<'tcx>;
    fn base_universe(&self) -> UniverseIndex;
    fn nice_error<'infcx>(
        &self,
        mbcx: &mut MirBorrowckCtxt<'_, 'infcx, 'tcx>,
        cause: ObligationCause<'tcx>,
        placeholder_region: Region<'tcx>,
        error_region: Option<Region<'tcx>>,
    ) -> Option<Diag<'infcx>>;

    // Provided method
    fn report_erroneous_element(
        &self,
        mbcx: &mut MirBorrowckCtxt<'_, '_, 'tcx>,
        placeholder: PlaceholderRegion<'tcx>,
        error_element: Option<PlaceholderRegion<'tcx>>,
        cause: ObligationCause<'tcx>,
    ) { ... }
}

Required Methods§

Source

fn fallback_error(&self, tcx: TyCtxt<'tcx>, span: Span) -> Diag<'tcx>

Returns an error to be reported if rerunning the type op fails to recover the error’s cause.

Source

fn base_universe(&self) -> UniverseIndex

Source

fn nice_error<'infcx>( &self, mbcx: &mut MirBorrowckCtxt<'_, 'infcx, 'tcx>, cause: ObligationCause<'tcx>, placeholder_region: Region<'tcx>, error_region: Option<Region<'tcx>>, ) -> Option<Diag<'infcx>>

Provided Methods§

Source

fn report_erroneous_element( &self, mbcx: &mut MirBorrowckCtxt<'_, '_, 'tcx>, placeholder: PlaceholderRegion<'tcx>, error_element: Option<PlaceholderRegion<'tcx>>, cause: ObligationCause<'tcx>, )

Constraints require that error_element appear in the values of placeholder, but this cannot be proven to hold. Report an error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'tcx, T> TypeOpInfo<'tcx> for DeeplyNormalizeQuery<'tcx, T>
where T: Copy + Display + TypeFoldable<TyCtxt<'tcx>> + 'tcx,

Source§

impl<'tcx, T> TypeOpInfo<'tcx> for NormalizeQuery<'tcx, T>
where T: Copy + Display + TypeFoldable<TyCtxt<'tcx>> + 'tcx,

Source§

impl<'tcx> TypeOpInfo<'tcx> for AscribeUserTypeQuery<'tcx>

Source§

impl<'tcx> TypeOpInfo<'tcx> for InstantiateOpaqueType<'tcx>

Source§

impl<'tcx> TypeOpInfo<'tcx> for PredicateQuery<'tcx>