Expand description
See Rustc Dev Guide chapters on trait-resolution and trait-specialization for more info on how this works.
Re-exportsΒ§
use std::fmt::Debug;πuse std::fmt::Debug;πuse rustc_data_structures::fx::FxHashSet;πuse rustc_data_structures::fx::FxIndexSet;πuse rustc_errors::Diag;πuse rustc_hir::def_id::CRATE_DEF_ID;πuse rustc_hir::def_id::DefId;πuse rustc_infer::infer::DefineOpaqueTypes;πuse rustc_infer::infer::InferCtxt;πuse rustc_infer::infer::TyCtxtInferExt;πuse rustc_infer::traits::PredicateObligations;πuse rustc_infer::traits::TraitErrors;πuse rustc_macros::TypeFoldable;πuse rustc_macros::TypeVisitable;πuse rustc_middle::traits::query::NoSolution;πuse rustc_middle::traits::solve::CandidateSource;πuse rustc_middle::traits::solve::Certainty;πuse rustc_middle::traits::solve::Goal;πuse rustc_middle::traits::specialization_graph::OverlapMode;πuse rustc_middle::ty::fast_reject::DeepRejectCtxt;πuse rustc_middle::ty;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::ty::TypeSuperVisitable;πuse rustc_middle::ty::TypeVisitable;πuse rustc_middle::ty::TypeVisitableExt;πuse rustc_middle::ty::TypeVisitor;πuse rustc_middle::ty::TypingMode;πuse rustc_middle::ty::Unnormalized;πuse rustc_next_trait_solver::solve::SolverDelegateEvalExt;πuse rustc_span::DUMMY_SP;πuse rustc_span::Span;πuse rustc_span::bug;πuse tracing::debug;πuse tracing::instrument;πuse tracing::instrument;πuse tracing::warn;πuse super::ObligationCtxt;πuse crate::error_reporting::traits::suggest_new_overflow_limit;πuse crate::infer::InferOk;πuse crate::solve::inspect::InferCtxtProofTreeExt;πuse crate::solve::inspect::InspectGoal;πuse crate::solve::inspect::ProofTreeVisitor;πuse crate::solve::SolverDelegate;πuse crate::solve::deeply_normalize_for_diagnostics;πuse crate::solve::inspect;πuse crate::traits::query::evaluate_obligation::InferCtxtExt;πuse crate::traits::select::IntercrateAmbiguityCause;πuse crate::traits::FulfillmentErrorCode;πuse crate::traits::Obligation;πuse crate::traits::ObligationCause;πuse crate::traits::PredicateObligation;πuse crate::traits::SkipLeakCheck;πuse crate::traits::util;π
StructsΒ§
- Ambiguity
Causes πVisitor - Impl
Header - The βheaderβ of an impl is everything outside the body: a Self type, a trait ref (in the case of a trait impl), and a set of predicates (from the bounds / where-clauses).
- Overlap
Result - Uncovered
TyParams
EnumsΒ§
- Conflict
- InCrate
- Whether we do the orphan check relative to this crate or to some remote crate.
- Intersection
HasImpossible πObligations - The result of [fn impl_intersection_has_impossible_obligation].
- IsFirst
Input Type - Orphan
Check Err - Orphan
Check Mode
FunctionsΒ§
- add_
placeholder_ note - compute_
intercrate_ πambiguity_ causes - Compute the
intercrate_ambiguity_causesfor the new solver using βproof treesβ. - equate_
impl_ πheaders - fresh_
impl_ πheader - impl_
intersection_ πhas_ impossible_ obligation - Check if both impls can be satisfied by a common type by considering whether any of either implβs obligations is not known to hold.
- impl_
intersection_ πhas_ negative_ obligation - Check if both impls can be satisfied by a common type by considering whether any of first implβs obligations is known not to hold via a negative predicate.
- orphan_
check_ trait_ ref - Checks whether a trait-ref is potentially implementable by a crate.
- overlap π
- Can both impl
aand implbbe satisfied by a common type (including where-clauses)? If so, returns anImplHeaderthat unifies the two impls. - overlapping_
impls π - overlapping_
inherent_ impls - If there are types that satisfy both impls, returns
Somewith a suitably-freshenedImplHeaderwith those types instantiated. Otherwise, returnsNone. - overlapping_
trait_ impls - If there are types that satisfy both impls, returns
Somewith a suitably-freshenedImplHeaderwith those types instantiated. Otherwise, returnsNone. - plug_
infer_ πwith_ placeholders - search_
ambiguity_ πcauses - suggest_
increasing_ πrecursion_ limit - trait_
ref_ is_ knowable - Returns whether all impls which would apply to the
trait_refe.g.Ty: Trait<Arg>are already known in the local crate. - trait_
ref_ is_ local_ or_ fundamental - try_
prove_ πnegated_ where_ clause