Module rustc::traits [−][src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Resolution. See rustc guide for more info on how this works.
Re-exports
pub use self::SelectionError::*; |
pub use self::FulfillmentErrorCode::*; |
pub use self::Vtable::*; |
pub use self::ObligationCauseCode::*; |
Modules
auto_trait |
[ Experimental ] Support code for rustdoc and external tools . You really don't want to be using this unless you need to. |
codegen |
[ Experimental ]
|
coherence |
[ Experimental ] See rustc guide chapters on trait-resolution and trait-specialization for more info on how this works. |
engine |
[ Experimental ]
|
error_reporting |
[ Experimental ]
|
fulfill |
[ Experimental ]
|
object_safety |
[ Experimental ] "Object safety" refers to the ability for a trait to be converted to an object. In general, traits may only be converted to an object if all of their methods meet certain criteria. In particular, they must: |
on_unimplemented |
[ Experimental ]
|
project |
[ Experimental ] Code for projecting associated types out of trait references. |
query |
[ Experimental ] Experimental types for the trait query interface. The methods
defined in this module are all based on canonicalization,
which makes a canonical query by replacing unbound inference
variables and regions, so that results can be reused more broadly.
The providers for the queries defined here can be found in
|
select |
[ Experimental ] See rustc guide for more info on how this works. |
specialization_graph |
[ Experimental ]
|
specialize |
[ Experimental ] Logic and data structures related to impl specialization, explained in greater detail below. |
structural_impls |
[ Experimental ]
|
util |
[ Experimental ]
|
Structs
DerivedObligationCause |
[ Experimental ]
|
EvaluationCache |
[ Experimental ]
|
FulfillmentContext |
[ Experimental ] The fulfillment context is used to drive trait resolution. It
consists of a list of obligations that must be (eventually)
satisfied. The job is to track which are satisfied, which yielded
errors, and which are still pending. At any point, users can call
|
FulfillmentError |
[ Experimental ]
|
MismatchedProjectionTypes |
[ Experimental ]
|
Normalized |
[ Experimental ]
|
Obligation |
[ Experimental ] An |
ObligationCause |
[ Experimental ] Why did we incur this obligation? Used for error reporting. |
OnUnimplementedDirective |
[ Experimental ]
|
OnUnimplementedNote |
[ Experimental ]
|
OverflowError |
[ Experimental ] Indicates that trait evaluation caused overflow. |
OverlapError |
[ Experimental ] Information pertinent to an overlapping impl error. |
OverlapResult |
[ Experimental ]
|
PendingPredicateObligation |
[ Experimental ]
|
ProgramClause |
[ Experimental ] A "program clause" has the form |
ProjectionCache |
[ Experimental ] The projection cache. Unlike the standard caches, this can include infcx-dependent type variables - therefore, we have to roll the cache back each time we roll a snapshot back, to avoid assumptions on yet-unresolved inference variables. Types with skolemized regions also have to be removed when the respective snapshot ends. |
ProjectionCacheSnapshot |
[ Experimental ]
|
SelectionCache |
[ Experimental ]
|
SelectionContext |
[ Experimental ]
|
SpecializesCache |
[ Experimental ]
|
SupertraitDefIds |
[ Experimental ]
|
VtableAutoImplData |
[ Experimental ]
|
VtableBuiltinData |
[ Experimental ]
|
VtableClosureData |
[ Experimental ]
|
VtableFnPointerData |
[ Experimental ]
|
VtableGeneratorData |
[ Experimental ]
|
VtableImplData |
[ Experimental ] Identifies a particular impl in the source, along with a set of
substitutions from the impl's type/lifetime parameters. The
|
VtableObjectData |
[ Experimental ] A vtable for some object-safe trait |
Enums
Clause |
[ Experimental ] This matches the definition from Page 7 of "A Proof Procedure for the Logic of Hereditary Harrop Formulas". |
DomainGoal |
[ Experimental ]
|
EvaluationResult |
[ Experimental ] The result of trait evaluation. The order is important here as the evaluation of a list is the maximum of the evaluations. |
FromEnv |
[ Experimental ]
|
FulfillmentErrorCode |
[ Experimental ]
|
Goal |
[ Experimental ]
|
IntercrateAmbiguityCause |
[ Experimental ]
|
IntercrateMode |
[ Experimental ]
|
MethodViolationCode |
[ Experimental ] Reasons a method might not be object-safe. |
ObjectSafetyViolation |
[ Experimental ]
|
ObligationCauseCode |
[ Experimental ]
|
OrphanCheckErr |
[ Experimental ]
|
QuantifierKind |
[ Experimental ]
|
Reveal |
[ Experimental ] Depending on the stage of compilation, we want projection to be more or less conservative. |
SelectionError |
[ Experimental ]
|
TraitQueryMode |
[ Experimental ]
|
Vtable |
[ Experimental ] Given the successful resolution of an obligation, the |
WellFormed |
[ Experimental ]
|
WhereClause |
[ Experimental ] The following types: |
Traits
ExClauseFold |
[ Experimental ]
|
ExClauseLift |
[ Experimental ]
|
TraitEngine |
[ Experimental ]
|
TraitEngineExt |
[ Experimental ]
|
Functions
elaborate_predicates |
[ Experimental ]
|
find_associated_item |
[ Experimental ] Given a selected impl described by |
fully_normalize |
[ Experimental ]
|
normalize |
[ Experimental ] Normalizes any associated type projections in |
normalize_and_test_predicates |
[ Experimental ] Normalizes the predicates and checks whether they hold in an empty environment. If this returns false, then either normalize encountered an error or one of the predicates did not hold. Used when creating vtables to check for unsatisfiable methods. |
normalize_param_env_or_error |
[ Experimental ] Normalizes the parameter environment, reporting errors if they occur. |
normalize_projection_type |
[ Experimental ] The guts of |
orphan_check |
[ Experimental ] Checks the coherence orphan rules. |
overlapping_impls |
[ Experimental ] If there are types that satisfy both impls, invokes |
poly_project_and_unify_type |
[ Experimental ] Evaluates constraints of the form: |
predicates_for_generics |
[ Experimental ] Creates predicate obligations from the generic bounds. |
provide |
[ Experimental ]
|
substitute_normalize_and_test_predicates |
[ Experimental ]
|
supertrait_def_ids |
[ Experimental ]
|
supertraits |
[ Experimental ]
|
transitive_bounds |
[ Experimental ]
|
translate_substs |
[ Experimental ] Given a subst for the requested impl, translate it to a subst appropriate for the actual item definition (whether it be in that impl, a parent impl, or the trait). |
type_known_to_meet_bound |
[ Experimental ] Determines whether the type |
vtable_methods |
[ Experimental ] Given a trait |
Type Definitions
Clauses |
[ Experimental ] Multiple clauses. |
Goals |
[ Experimental ]
|
Obligations |
[ Experimental ]
|
PolyDomainGoal |
[ Experimental ]
|
PredicateObligation |
[ Experimental ]
|
PredicateObligations |
[ Experimental ]
|
Selection |
[ Experimental ]
|
SelectionResult |
[ Experimental ] When performing resolution, it is typically the case that there can be one of three outcomes: |
Supertraits |
[ Experimental ]
|
TraitObligation |
[ Experimental ]
|
TraitObligations |
[ Experimental ]
|