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,
        error_element: RegionElement,
        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, error_element: RegionElement, cause: ObligationCause<'tcx>, )

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

Implementors§

Source§

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

Source§

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

Source§

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

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,