pub trait TypeErrCtxtExt<'tcx> {
    // Required methods
    fn report_fulfillment_errors(
        &self,
        errors: Vec<FulfillmentError<'tcx>>
    ) -> ErrorGuaranteed;
    fn report_overflow_error<T>(
        &self,
        predicate: &T,
        span: Span,
        suggest_increasing_limit: bool,
        mutate: impl FnOnce(&mut DiagnosticBuilder<'_>)
    ) -> !
       where T: Display + TypeFoldable<TyCtxt<'tcx>> + Print<'tcx, FmtPrinter<'tcx, 'tcx>>;
    fn build_overflow_error<T>(
        &self,
        predicate: &T,
        span: Span,
        suggest_increasing_limit: bool
    ) -> DiagnosticBuilder<'tcx>
       where T: Display + TypeFoldable<TyCtxt<'tcx>> + Print<'tcx, FmtPrinter<'tcx, 'tcx>>;
    fn report_overflow_obligation<T>(
        &self,
        obligation: &Obligation<'tcx, T>,
        suggest_increasing_limit: bool
    ) -> !
       where T: ToPredicate<'tcx> + Clone;
    fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder<'_>);
    fn report_overflow_obligation_cycle(
        &self,
        cycle: &[PredicateObligation<'tcx>]
    ) -> !;
    fn report_overflow_no_abort(
        &self,
        obligation: PredicateObligation<'tcx>
    ) -> 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 DiagnosticBuilder<'_>
    ) -> bool;
    fn report_const_param_not_wf(
        &self,
        ty: Ty<'tcx>,
        obligation: &PredicateObligation<'tcx>
    ) -> DiagnosticBuilder<'tcx>;
}

Required Methods§

source

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

source

fn report_overflow_error<T>( &self, predicate: &T, span: Span, suggest_increasing_limit: bool, mutate: impl FnOnce(&mut DiagnosticBuilder<'_>) ) -> !
where T: Display + TypeFoldable<TyCtxt<'tcx>> + Print<'tcx, FmtPrinter<'tcx, 'tcx>>,

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<T>( &self, predicate: &T, span: Span, suggest_increasing_limit: bool ) -> DiagnosticBuilder<'tcx>
where T: Display + TypeFoldable<TyCtxt<'tcx>> + Print<'tcx, FmtPrinter<'tcx, '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 suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder<'_>)

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> ) -> 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 DiagnosticBuilder<'_> ) -> 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> ) -> DiagnosticBuilder<'tcx>

Object Safety§

This trait is not object safe.

Implementors§

source§

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