pub trait TypeErrCtxtExt<'tcx> {
    // Required methods
    fn report_fulfillment_errors(
        &self,
        errors: Vec<FulfillmentError<'tcx>>
    ) -> ErrorGuaranteed;
    fn report_overflow_error(
        &self,
        cause: OverflowCause<'tcx>,
        span: Span,
        suggest_increasing_limit: bool,
        mutate: impl FnOnce(&mut Diag<'_>)
    ) -> !;
    fn build_overflow_error(
        &self,
        cause: OverflowCause<'tcx>,
        span: Span,
        suggest_increasing_limit: bool
    ) -> Diag<'tcx>;
    fn report_overflow_obligation<T>(
        &self,
        obligation: &Obligation<'tcx, T>,
        suggest_increasing_limit: bool
    ) -> !
       where T: ToPredicate<'tcx> + Clone;
    fn report_overflow_obligation_cycle(
        &self,
        cycle: &[PredicateObligation<'tcx>]
    ) -> !;
    fn report_overflow_no_abort(
        &self,
        obligation: PredicateObligation<'tcx>,
        suggest_increasing_limit: bool
    ) -> ErrorGuaranteed;
    fn report_selection_error(
        &self,
        obligation: PredicateObligation<'tcx>,
        root_obligation: &PredicateObligation<'tcx>,
        error: &SelectionError<'tcx>
    ) -> ErrorGuaranteed;
    fn emit_specialized_closure_kind_error(
        &self,
        obligation: &PredicateObligation<'tcx>,
        trait_ref: PolyTraitRef<'tcx>
    ) -> Option<ErrorGuaranteed>;
    fn fn_arg_obligation(
        &self,
        obligation: &PredicateObligation<'tcx>
    ) -> Result<(), ErrorGuaranteed>;
    fn try_conversion_context(
        &self,
        obligation: &PredicateObligation<'tcx>,
        trait_ref: TraitRef<'tcx>,
        err: &mut Diag<'_>
    ) -> bool;
    fn report_const_param_not_wf(
        &self,
        ty: Ty<'tcx>,
        obligation: &PredicateObligation<'tcx>
    ) -> Diag<'tcx>;
}

Required Methods§

source

fn report_fulfillment_errors( &self, errors: Vec<FulfillmentError<'tcx>> ) -> ErrorGuaranteed

source

fn report_overflow_error( &self, cause: OverflowCause<'tcx>, span: Span, suggest_increasing_limit: bool, mutate: impl FnOnce(&mut Diag<'_>) ) -> !

Reports that an overflow has occurred and halts compilation. We halt compilation unconditionally because it is important that overflows never be masked – they basically represent computations whose result could not be truly determined and thus we can’t say if the program type checks or not – and they are unusual occurrences in any case.

source

fn build_overflow_error( &self, cause: OverflowCause<'tcx>, span: Span, suggest_increasing_limit: bool ) -> Diag<'tcx>

source

fn report_overflow_obligation<T>( &self, obligation: &Obligation<'tcx, T>, suggest_increasing_limit: bool ) -> !
where T: ToPredicate<'tcx> + Clone,

Reports that an overflow has occurred and halts compilation. We halt compilation unconditionally because it is important that overflows never be masked – they basically represent computations whose result could not be truly determined and thus we can’t say if the program type checks or not – and they are unusual occurrences in any case.

source

fn report_overflow_obligation_cycle( &self, cycle: &[PredicateObligation<'tcx>] ) -> !

Reports that a cycle was detected which led to overflow and halts compilation. This is equivalent to report_overflow_obligation except that we can give a more helpful error message (and, in particular, we do not suggest increasing the overflow limit, which is not going to help).

source

fn report_overflow_no_abort( &self, obligation: PredicateObligation<'tcx>, suggest_increasing_limit: bool ) -> ErrorGuaranteed

source

fn report_selection_error( &self, obligation: PredicateObligation<'tcx>, root_obligation: &PredicateObligation<'tcx>, error: &SelectionError<'tcx> ) -> ErrorGuaranteed

The root_obligation parameter should be the root_obligation field from a FulfillmentError. If no FulfillmentError is available, then it should be the same as obligation.

source

fn emit_specialized_closure_kind_error( &self, obligation: &PredicateObligation<'tcx>, trait_ref: PolyTraitRef<'tcx> ) -> Option<ErrorGuaranteed>

source

fn fn_arg_obligation( &self, obligation: &PredicateObligation<'tcx> ) -> Result<(), ErrorGuaranteed>

source

fn try_conversion_context( &self, obligation: &PredicateObligation<'tcx>, trait_ref: TraitRef<'tcx>, err: &mut Diag<'_> ) -> bool

When the E of the resulting Result<T, E> in an expression foo().bar().baz()?, identify thoe method chain sub-expressions that could or could not have been annotated with ?.

source

fn report_const_param_not_wf( &self, ty: Ty<'tcx>, obligation: &PredicateObligation<'tcx> ) -> Diag<'tcx>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx>