pub trait InferCtxtExt<'tcx> {
Show 23 methods
fn suggest_restricting_param_bound(
&self,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>,
associated_item: Option<(&'static str, Ty<'tcx>)>,
body_id: HirId
);
fn suggest_dereferences(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool;
fn get_closure_name(
&self,
def_id: DefId,
err: &mut Diagnostic,
msg: &str
) -> Option<Symbol>;
fn suggest_fn_call(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool;
fn suggest_add_reference_to_arg(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>,
has_custom_message: bool
) -> bool;
fn suggest_borrowing_for_object_cast(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>,
self_ty: Ty<'tcx>,
object_ty: Ty<'tcx>
);
fn suggest_remove_reference(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool;
fn suggest_remove_await(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic
);
fn suggest_change_mut(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
);
fn suggest_semicolon_removal(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
span: Span,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool;
fn return_type_span(
&self,
obligation: &PredicateObligation<'tcx>
) -> Option<Span>;
fn suggest_impl_trait(
&self,
err: &mut Diagnostic,
span: Span,
obligation: &PredicateObligation<'tcx>,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool;
fn point_at_returns_when_relevant(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
);
fn report_closure_arg_mismatch(
&self,
span: Span,
found_span: Option<Span>,
found: PolyTraitRef<'tcx>,
expected: PolyTraitRef<'tcx>
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>;
fn suggest_fully_qualified_path(
&self,
err: &mut Diagnostic,
item_def_id: DefId,
span: Span,
trait_ref: DefId
);
fn maybe_note_obligation_cause_for_async_await(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
) -> bool;
fn note_obligation_cause_for_async_await(
&self,
err: &mut Diagnostic,
interior_or_upvar_span: GeneratorInteriorOrUpvar,
interior_extra_info: Option<(Option<Span>, Span, Option<HirId>, Option<Span>)>,
is_async: bool,
outer_generator: Option<DefId>,
trait_pred: TraitPredicate<'tcx>,
target_ty: Ty<'tcx>,
typeck_results: Option<&TypeckResults<'tcx>>,
obligation: &PredicateObligation<'tcx>,
next_code: Option<&ObligationCauseCode<'tcx>>
);
fn note_obligation_cause_code<T>(
&self,
err: &mut Diagnostic,
predicate: &T,
param_env: ParamEnv<'tcx>,
cause_code: &ObligationCauseCode<'tcx>,
obligated_types: &mut Vec<Ty<'tcx>>,
seen_requirements: &mut FxHashSet<DefId>
)
where
T: Display;
fn suggest_new_overflow_limit(&self, err: &mut Diagnostic);
fn suggest_await_before_try(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>,
trait_pred: PolyTraitPredicate<'tcx>,
span: Span
);
fn suggest_floating_point_literal(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_ref: &PolyTraitRef<'tcx>
);
fn suggest_derive(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
);
fn suggest_dereferencing_index(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
);
}
Required Methods
sourcefn suggest_restricting_param_bound(
fn suggest_restricting_param_bound(
&self,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>,
associated_item: Option<(&'static str, Ty<'tcx>)>,
body_id: HirId
)
sourcefn suggest_dereferences(
fn suggest_dereferences(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool
sourcefn get_closure_name(
fn get_closure_name(
&self,
def_id: DefId,
err: &mut Diagnostic,
msg: &str
) -> Option<Symbol>
sourcefn suggest_fn_call(
fn suggest_fn_call(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool
sourcefn suggest_add_reference_to_arg(
fn suggest_add_reference_to_arg(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>,
has_custom_message: bool
) -> bool
sourcefn suggest_borrowing_for_object_cast(
fn suggest_borrowing_for_object_cast(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>,
self_ty: Ty<'tcx>,
object_ty: Ty<'tcx>
)
sourcefn suggest_remove_reference(
fn suggest_remove_reference(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool
sourcefn suggest_remove_await(
fn suggest_remove_await(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic
)
sourcefn suggest_change_mut(
fn suggest_change_mut(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
)
sourcefn suggest_semicolon_removal(
fn suggest_semicolon_removal(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
span: Span,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool
sourcefn return_type_span(
fn return_type_span(
&self,
obligation: &PredicateObligation<'tcx>
) -> Option<Span>
sourcefn suggest_impl_trait(
fn suggest_impl_trait(
&self,
err: &mut Diagnostic,
span: Span,
obligation: &PredicateObligation<'tcx>,
trait_pred: PolyTraitPredicate<'tcx>
) -> bool
sourcefn point_at_returns_when_relevant(
fn point_at_returns_when_relevant(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
)
sourcefn report_closure_arg_mismatch(
fn report_closure_arg_mismatch(
&self,
span: Span,
found_span: Option<Span>,
found: PolyTraitRef<'tcx>,
expected: PolyTraitRef<'tcx>
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed>
sourcefn suggest_fully_qualified_path(
fn suggest_fully_qualified_path(
&self,
err: &mut Diagnostic,
item_def_id: DefId,
span: Span,
trait_ref: DefId
)
sourcefn maybe_note_obligation_cause_for_async_await(
fn maybe_note_obligation_cause_for_async_await(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
) -> bool
sourcefn note_obligation_cause_for_async_await(
fn note_obligation_cause_for_async_await(
&self,
err: &mut Diagnostic,
interior_or_upvar_span: GeneratorInteriorOrUpvar,
interior_extra_info: Option<(Option<Span>, Span, Option<HirId>, Option<Span>)>,
is_async: bool,
outer_generator: Option<DefId>,
trait_pred: TraitPredicate<'tcx>,
target_ty: Ty<'tcx>,
typeck_results: Option<&TypeckResults<'tcx>>,
obligation: &PredicateObligation<'tcx>,
next_code: Option<&ObligationCauseCode<'tcx>>
)
sourcefn note_obligation_cause_code<T>(
fn note_obligation_cause_code<T>(
&self,
err: &mut Diagnostic,
predicate: &T,
param_env: ParamEnv<'tcx>,
cause_code: &ObligationCauseCode<'tcx>,
obligated_types: &mut Vec<Ty<'tcx>>,
seen_requirements: &mut FxHashSet<DefId>
)where
T: Display,
source
fn suggest_new_overflow_limit(&self, err: &mut Diagnostic)
sourcefn suggest_await_before_try(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>,
trait_pred: PolyTraitPredicate<'tcx>,
span: Span
)
fn suggest_await_before_try(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>,
trait_pred: PolyTraitPredicate<'tcx>,
span: Span
)
Suggest to await before try: future? => future.await?
sourcefn suggest_floating_point_literal(
fn suggest_floating_point_literal(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_ref: &PolyTraitRef<'tcx>
)
sourcefn suggest_derive(
fn suggest_derive(
&self,
obligation: &PredicateObligation<'tcx>,
err: &mut Diagnostic,
trait_pred: PolyTraitPredicate<'tcx>
)
sourcefn suggest_dereferencing_index(