trait InferCtxtPrivExt<'hir, 'tcx> {
Show 19 methods
fn error_implies(&self, cond: Predicate<'tcx>, error: Predicate<'tcx>) -> bool;
fn report_fulfillment_error(
&self,
error: &FulfillmentError<'tcx>,
body_id: Option<BodyId>,
fallback_has_occurred: bool
);
fn report_projection_error(
&self,
obligation: &PredicateObligation<'tcx>,
error: &MismatchedProjectionTypes<'tcx>
);
fn maybe_detailed_projection_msg(
&self,
pred: ProjectionPredicate<'tcx>,
normalized_ty: Term<'tcx>,
expected_ty: Term<'tcx>
) -> Option<String>;
fn fuzzy_match_tys(
&self,
a: Ty<'tcx>,
b: Ty<'tcx>,
ignoring_lifetimes: bool
) -> Option<CandidateSimilarity>;
fn describe_generator(&self, body_id: BodyId) -> Option<&'static str>;
fn find_similar_impl_candidates(
&self,
trait_pred: PolyTraitPredicate<'tcx>
) -> Vec<ImplCandidate<'tcx>>;
fn report_similar_impl_candidates(
&self,
impl_candidates: Vec<ImplCandidate<'tcx>>,
trait_ref: PolyTraitRef<'tcx>,
body_id: HirId,
err: &mut Diagnostic
) -> bool;
fn get_parent_trait_ref(
&self,
code: &ObligationCauseCode<'tcx>
) -> Option<(String, Option<Span>)>;
fn note_version_mismatch(
&self,
err: &mut Diagnostic,
trait_ref: &PolyTraitRef<'tcx>
) -> bool;
fn mk_trait_obligation_with_new_self_ty(
&self,
param_env: ParamEnv<'tcx>,
trait_ref_and_ty: Binder<'tcx, (TraitPredicate<'tcx>, Ty<'tcx>)>
) -> PredicateObligation<'tcx>;
fn maybe_report_ambiguity(
&self,
obligation: &PredicateObligation<'tcx>,
body_id: Option<BodyId>
);
fn predicate_can_apply(
&self,
param_env: ParamEnv<'tcx>,
pred: PolyTraitRef<'tcx>
) -> bool;
fn note_obligation_cause(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
);
fn suggest_unsized_bound_if_applicable(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
);
fn annotate_source_of_ambiguity(
&self,
err: &mut Diagnostic,
impls: &[DefId],
predicate: Predicate<'tcx>
);
fn maybe_suggest_unsized_generics(
&self,
err: &mut Diagnostic,
span: Span,
node: Node<'hir>
);
fn maybe_indirection_for_unsized(
&self,
err: &mut Diagnostic,
item: &'hir Item<'hir>,
param: &'hir GenericParam<'hir>
) -> bool;
fn is_recursive_obligation(
&self,
obligated_types: &mut Vec<Ty<'tcx>>,
cause_code: &ObligationCauseCode<'tcx>
) -> bool;
}
Required Methods
source
fn error_implies(&self, cond: Predicate<'tcx>, error: Predicate<'tcx>) -> bool
sourcefn report_fulfillment_error(
fn report_fulfillment_error(
&self,
error: &FulfillmentError<'tcx>,
body_id: Option<BodyId>,
fallback_has_occurred: bool
)
sourcefn report_projection_error(
fn report_projection_error(
&self,
obligation: &PredicateObligation<'tcx>,
error: &MismatchedProjectionTypes<'tcx>
)
sourcefn maybe_detailed_projection_msg(
fn maybe_detailed_projection_msg(
&self,
pred: ProjectionPredicate<'tcx>,
normalized_ty: Term<'tcx>,
expected_ty: Term<'tcx>
) -> Option<String>
sourcefn fuzzy_match_tys(
fn fuzzy_match_tys(
&self,
a: Ty<'tcx>,
b: Ty<'tcx>,
ignoring_lifetimes: bool
) -> Option<CandidateSimilarity>
source
fn describe_generator(&self, body_id: BodyId) -> Option<&'static str>
sourcefn find_similar_impl_candidates(
fn find_similar_impl_candidates(
&self,
trait_pred: PolyTraitPredicate<'tcx>
) -> Vec<ImplCandidate<'tcx>>
sourcefn report_similar_impl_candidates(
fn report_similar_impl_candidates(
&self,
impl_candidates: Vec<ImplCandidate<'tcx>>,
trait_ref: PolyTraitRef<'tcx>,
body_id: HirId,
err: &mut Diagnostic
) -> bool
sourcefn get_parent_trait_ref(
&self,
code: &ObligationCauseCode<'tcx>
) -> Option<(String, Option<Span>)>
fn get_parent_trait_ref(
&self,
code: &ObligationCauseCode<'tcx>
) -> Option<(String, Option<Span>)>
Gets the parent trait chain start
sourcefn note_version_mismatch(
&self,
err: &mut Diagnostic,
trait_ref: &PolyTraitRef<'tcx>
) -> bool
fn note_version_mismatch(
&self,
err: &mut Diagnostic,
trait_ref: &PolyTraitRef<'tcx>
) -> bool
If the Self
type of the unsatisfied trait trait_ref
implements a trait
with the same path as trait_ref
, a help message about
a probable version mismatch is added to err
sourcefn mk_trait_obligation_with_new_self_ty(
&self,
param_env: ParamEnv<'tcx>,
trait_ref_and_ty: Binder<'tcx, (TraitPredicate<'tcx>, Ty<'tcx>)>
) -> PredicateObligation<'tcx>
fn mk_trait_obligation_with_new_self_ty(
&self,
param_env: ParamEnv<'tcx>,
trait_ref_and_ty: Binder<'tcx, (TraitPredicate<'tcx>, Ty<'tcx>)>
) -> PredicateObligation<'tcx>
Creates a PredicateObligation
with new_self_ty
replacing the existing type in the
trait_ref
.
For this to work, new_self_ty
must have no escaping bound variables.
sourcefn maybe_report_ambiguity(
fn maybe_report_ambiguity(
&self,
obligation: &PredicateObligation<'tcx>,
body_id: Option<BodyId>
)
sourcefn predicate_can_apply(
fn predicate_can_apply(
&self,
param_env: ParamEnv<'tcx>,
pred: PolyTraitRef<'tcx>
) -> bool
sourcefn note_obligation_cause(
fn note_obligation_cause(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
)
sourcefn suggest_unsized_bound_if_applicable(
fn suggest_unsized_bound_if_applicable(
&self,
err: &mut Diagnostic,
obligation: &PredicateObligation<'tcx>
)
sourcefn annotate_source_of_ambiguity(
fn annotate_source_of_ambiguity(
&self,
err: &mut Diagnostic,
impls: &[DefId],
predicate: Predicate<'tcx>
)
sourcefn maybe_suggest_unsized_generics(
fn maybe_suggest_unsized_generics(
&self,
err: &mut Diagnostic,
span: Span,
node: Node<'hir>
)
sourcefn maybe_indirection_for_unsized(
fn maybe_indirection_for_unsized(
&self,
err: &mut Diagnostic,
item: &'hir Item<'hir>,
param: &'hir GenericParam<'hir>
) -> bool
sourcefn is_recursive_obligation(