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§
Sourcefn fallback_error(&self, tcx: TyCtxt<'tcx>, span: Span) -> Diag<'tcx>
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.
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 Methods§
Sourcefn report_erroneous_element(
&self,
mbcx: &mut MirBorrowckCtxt<'_, '_, 'tcx>,
placeholder: PlaceholderRegion<'tcx>,
error_element: Option<PlaceholderRegion<'tcx>>,
cause: ObligationCause<'tcx>,
)
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".