Expand description
Candidate selection. See the rustc dev guide for more information on how this works.
Re-exportsΒ§
use std::cell::Cell;πuse std::cell::RefCell;πuse std::cmp;πuse std::fmt;πuse std::fmt::Display;πuse std::ops::ControlFlow;πuse hir::def::DefKind;πuse rustc_attr_ir::lang_items::LangItem;πuse rustc_data_structures::fx::FxIndexMap;πuse rustc_data_structures::fx::FxIndexSet;πuse rustc_errors::Diag;πuse rustc_hir as hir;πuse rustc_hir::def_id::DefId;πuse rustc_infer::infer::BoundRegionConversionTime;πuse rustc_infer::infer::BoundRegionConversionTime::HigherRankedType;πuse rustc_infer::infer::DefineOpaqueTypes;πuse rustc_infer::infer::at::ToTrace;πuse rustc_infer::infer::relate::TypeRelation;πuse rustc_infer::traits::ImplSource;πuse rustc_infer::traits::PredicateObligations;πuse rustc_infer::traits::TraitObligation;πuse rustc_macros::TypeFoldable;πuse rustc_macros::TypeVisitable;πuse rustc_middle::dep_graph::DepKind;πuse rustc_middle::dep_graph::DepNodeIndex;πuse rustc_middle::ty::abstract_const::NotConstEvaluatable;πuse rustc_middle::ty::error::TypeErrorToStringExt;πuse rustc_middle::ty::print::PrintTraitRefExt as _;πuse rustc_middle::ty::print::with_no_trimmed_paths;πuse rustc_middle::ty::print::with_no_trimmed_paths;πuse rustc_middle::ty;πuse rustc_middle::ty::CallerBoundsIterator;πuse rustc_middle::ty::CandidatePreferenceMode;πuse rustc_middle::ty::CantBeErased;πuse rustc_middle::ty::DeepRejectCtxt;πuse rustc_middle::ty::GenericArgs;πuse rustc_middle::ty::PolyProjectionClause;πuse rustc_middle::ty::SizedTraitKind;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::ty::TypeFoldable;πuse rustc_middle::ty::TypeVisitableExt;πuse rustc_middle::ty::TypingMode;πuse rustc_middle::ty::Unnormalized;πuse rustc_middle::ty::Upcast;πuse rustc_middle::ty::elaborate;πuse rustc_middle::ty::may_use_unstable_feature;πuse rustc_next_trait_solver::solve::AliasBoundKind;πuse rustc_span::bug;πuse tracing::debug;πuse tracing::instrument;πuse tracing::instrument;πuse tracing::trace;πuse super::project::ProjectionTermObligation;πuse super::util::closure_trait_ref_and_return_type;πuse super::ImplDerivedCause;πuse super::Normalized;πuse super::Obligation;πuse super::ObligationCause;πuse super::ObligationCauseCode;πuse super::PolyTraitObligation;πuse super::PredicateObligation;πuse super::Selection;πuse super::SelectionError;πuse super::SelectionResult;πuse super::TraitQueryMode;πuse super::const_evaluatable;πuse super::project;πuse super::util;πuse super::wf;πuse crate::error_reporting::InferCtxtErrorExt;πuse crate::infer::InferCtxt;πuse crate::infer::InferOk;πuse crate::infer::TypeFreshener;πuse crate::solve::InferCtxtSelectExt as _;πuse crate::traits::normalize::normalize_with_depth;πuse crate::traits::normalize::normalize_with_depth_to;πuse crate::traits::project::ProjectAndUnifyResult;πuse crate::traits::project::ProjectionCacheKeyExt;πuse crate::traits::EvaluateConstErr;πuse crate::traits::ProjectionCacheKey;πuse crate::traits::effects;πuse crate::traits::implicit_fast_path;πuse self::EvaluationResult::*;πuse self::SelectionCandidate::*;π
ModulesΒ§
- _match π
- candidate_
assembly π - Candidate assembly.
- confirmation π
- Confirmation.
StructsΒ§
- Auto
Impl πConstituents - Evaluated
Candidate π - Provisional
Evaluation π - A cache value for the provisional cache: contains the depth-first number (DFN) and result.
- Provisional
Evaluation πCache - The βprovisional evaluation cacheβ is used to store intermediate cache results when solving auto traits. Auto traits are unusual in that they can support cycles. So, for example, a βproof treeβ like this would be ok:
- Selection
Candidate πSet - Selection
Context - Trait
Obligation πStack - Trait
Obligation πStack List
EnumsΒ§
- Evaluation
Result - The result of trait evaluation. The order is important here as the evaluation of a list is the maximum of the evaluations.
- Intercrate
Ambiguity Cause - Overflow
Error - Indicates that trait evaluation caused overflow and in which pass.
- Projection
Matches πProjection - Selection
Candidate - The selection process begins by considering all impls, where
clauses, and so forth that might resolve an obligation. Sometimes
weβll be able to say definitively that (e.g.) an impl does not
apply to the obligation: perhaps it is defined for
usizebut the obligation is fori32. In that case, we drop the impl out of the list. But the other cases are considered candidates.