Trait rustc_trait_selection::traits::error_reporting::suggestions::InferCtxtExt[][src]

pub trait InferCtxtExt<'tcx> {
Show 18 methods fn suggest_restricting_param_bound(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        trait_ref: PolyTraitRef<'tcx>,
        body_id: HirId
    );
fn suggest_dereferences(
        &self,
        obligation: &PredicateObligation<'tcx>,
        err: &mut DiagnosticBuilder<'tcx>,
        trait_ref: PolyTraitRef<'tcx>
    );
fn get_closure_name(
        &self,
        def_id: DefId,
        err: &mut DiagnosticBuilder<'_>,
        msg: &str
    ) -> Option<String>;
fn suggest_fn_call(
        &self,
        obligation: &PredicateObligation<'tcx>,
        err: &mut DiagnosticBuilder<'_>,
        trait_ref: Binder<'tcx, TraitRef<'tcx>>
    );
fn suggest_add_reference_to_arg(
        &self,
        obligation: &PredicateObligation<'tcx>,
        err: &mut DiagnosticBuilder<'_>,
        trait_ref: &Binder<'tcx, TraitRef<'tcx>>,
        has_custom_message: bool
    ) -> bool;
fn suggest_remove_reference(
        &self,
        obligation: &PredicateObligation<'tcx>,
        err: &mut DiagnosticBuilder<'_>,
        trait_ref: Binder<'tcx, TraitRef<'tcx>>
    );
fn suggest_change_mut(
        &self,
        obligation: &PredicateObligation<'tcx>,
        err: &mut DiagnosticBuilder<'_>,
        trait_ref: Binder<'tcx, TraitRef<'tcx>>
    );
fn suggest_semicolon_removal(
        &self,
        obligation: &PredicateObligation<'tcx>,
        err: &mut DiagnosticBuilder<'_>,
        span: Span,
        trait_ref: Binder<'tcx, TraitRef<'tcx>>
    );
fn return_type_span(
        &self,
        obligation: &PredicateObligation<'tcx>
    ) -> Option<Span>;
fn suggest_impl_trait(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        span: Span,
        obligation: &PredicateObligation<'tcx>,
        trait_ref: Binder<'tcx, TraitRef<'tcx>>
    ) -> bool;
fn point_at_returns_when_relevant(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        obligation: &PredicateObligation<'tcx>
    );
fn report_closure_arg_mismatch(
        &self,
        span: Span,
        found_span: Option<Span>,
        expected_ref: PolyTraitRef<'tcx>,
        found: PolyTraitRef<'tcx>
    ) -> DiagnosticBuilder<'tcx>;
fn suggest_fully_qualified_path(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        def_id: DefId,
        span: Span,
        trait_ref: DefId
    );
fn maybe_note_obligation_cause_for_async_await(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        obligation: &PredicateObligation<'tcx>
    ) -> bool;
fn note_obligation_cause_for_async_await(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        interior_or_upvar_span: GeneratorInteriorOrUpvar,
        interior_extra_info: Option<(Option<Span>, Span, Option<HirId>, Option<Span>)>,
        inner_generator_body: Option<&Body<'tcx>>,
        outer_generator: Option<DefId>,
        trait_ref: TraitRef<'tcx>,
        target_ty: Ty<'tcx>,
        typeck_results: &TypeckResults<'tcx>,
        obligation: &PredicateObligation<'tcx>,
        next_code: Option<&ObligationCauseCode<'tcx>>
    );
fn note_obligation_cause_code<T>(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        predicate: &T,
        cause_code: &ObligationCauseCode<'tcx>,
        obligated_types: &mut Vec<&TyS<'tcx>>,
        seen_requirements: &mut FxHashSet<DefId>
    )
    where
        T: Display
;
fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder<'_>);
fn suggest_await_before_try(
        &self,
        err: &mut DiagnosticBuilder<'_>,
        obligation: &PredicateObligation<'tcx>,
        trait_ref: Binder<'tcx, TraitRef<'tcx>>,
        span: Span
    );
}

Required methods

Suggest to await before try: future? => future.await?

Implementors