[−][src]Module rustc_trait_selection::traits
Trait Resolution. See the rustc dev guide for more information on how this works.
Re-exports
pub use self::FulfillmentErrorCode::*; |
pub use self::ImplSource::*; |
pub use self::ObligationCauseCode::*; |
pub use self::SelectionError::*; |
Modules
| auto_trait | Support code for rustdoc and external tools. You really don't want to be using this unless you need to. |
| chalk_fulfill | Defines a Chalk-based |
| codegen | |
| coherence | See Rustc Dev Guide chapters on trait-resolution and trait-specialization for more info on how this works. |
| const_evaluatable | Checking that constant values used in types can be successfully evaluated. |
| engine | |
| error_reporting | |
| error_reporting | |
| fulfill | |
| misc | Miscellaneous type-system utilities that are too small to deserve their own modules. |
| object_safety | "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 | |
| project | Code for projecting associated types out of trait references. |
| query | 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
|
| query | 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 | Candidate selection. See the rustc dev guide for more information on how this works. |
| select | Candidate selection. See the rustc dev guide for more information on how this works. |
| specialization_graph | |
| specialization_graph | |
| specialize | Logic and data structures related to impl specialization, explained in greater detail below. |
| structural_match | |
| util | |
| util | |
| wf |
Structs
| ChalkEnvironmentAndGoal | A chalk environment and goal. |
| ChalkFulfillmentContext | |
| ChalkRustInterner | |
| DerivedObligationCause | |
| FulfillmentContext | 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 | |
| FutureCompatOverlapError | |
| IfExpressionCause | |
| ImplSourceAutoImplData | |
| ImplSourceBuiltinData | |
| ImplSourceClosureData | |
| ImplSourceDiscriminantKindData | |
| ImplSourceFnPointerData | |
| ImplSourceGeneratorData | |
| ImplSourceObjectData | |
| ImplSourceTraitAliasData | |
| ImplSourceUserDefinedData | Identifies a particular impl in the source, along with a set of
substitutions from the impl's type/lifetime parameters. The
|
| MatchExpressionArmCause | |
| MismatchedProjectionTypes | |
| Normalized | |
| Obligation | An |
| ObligationCause | The reason why we incurred this obligation; used for error reporting. |
| ObligationCauseData | |
| OnUnimplementedDirective | |
| OnUnimplementedNote | |
| OverflowError | Indicates that trait evaluation caused overflow. |
| OverlapError | Information pertinent to an overlapping impl error. |
| OverlapResult | |
| PendingPredicateObligation | |
| ProjectionCache | 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 placeholder regions also have to be removed when the respective snapshot ends. |
| ProjectionCacheKey | |
| ProjectionCacheStorage | |
| SelectionContext | |
| SupertraitDefIds | |
| TraitAliasExpander | "Trait alias expansion" is the process of expanding a sequence of trait
references into another sequence by transitively following all trait
aliases. e.g. If you have bounds like |
| UnifyReceiverContext |
Enums
| EvaluationResult | The result of trait evaluation. The order is important here as the evaluation of a list is the maximum of the evaluations. |
| FulfillmentErrorCode | |
| FutureCompatOverlapErrorKind | |
| ImplSource | Given the successful resolution of an obligation, the |
| IntercrateAmbiguityCause | |
| MethodViolationCode | Reasons a method might not be object-safe. |
| NonStructuralMatchTy | |
| ObjectSafetyViolation | |
| ObligationCauseCode | |
| OrphanCheckErr | |
| ProjectionCacheEntry | |
| Reveal | Depending on the stage of compilation, we want projection to be more or less conservative. |
| SelectionError | |
| SkipLeakCheck | Whether to skip the leak check, as part of a future compatibility warning step. |
| StatementAsExpression | |
| TraitQueryMode | The mode that trait queries run in. |
Traits
| TraitEngine | |
| TraitEngineExt | |
| TraitEngineExt |
Functions
| add_placeholder_note | |
| astconv_object_safety_violations | Returns the object safety violations that affect
astconv -- currently, |
| do_normalize_predicates | |
| elaborate_predicates | |
| elaborate_trait_ref | |
| elaborate_trait_refs | |
| expand_trait_aliases | |
| fully_normalize | |
| get_vtable_index_of_object_method | Given an upcast trait object described by |
| impl_item_is_final | |
| impossible_predicates | Normalizes the predicates and checks whether they hold in an empty environment. If this returns true, then either normalize encountered an error or one of the predicates did not hold. Used when creating vtables to check for unsatisfiable methods. |
| is_vtable_safe_method | We say a method is vtable safe if it can be invoked on a trait
object. Note that object-safe traits can have some
non-vtable-safe methods, so long as they require |
| normalize | Normalizes any associated type projections in |
| normalize_param_env_or_error | Normalizes the parameter environment, reporting errors if they occur. |
| normalize_projection_type | The guts of |
| normalize_to | |
| orphan_check | Checks the coherence orphan rules. |
| overlapping_impls | If there are types that satisfy both impls, invokes |
| predicate_for_trait_def | |
| predicates_for_generics | Creates predicate obligations from the generic bounds. |
| provide | |
| search_for_structural_match_violation | This method traverses the structure of |
| subst_and_check_impossible_predicates | |
| supertrait_def_ids | |
| supertraits | |
| transitive_bounds | |
| translate_substs | 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_implements_trait | Check whether a |
| type_known_to_meet_bound_modulo_regions | Determines whether the type |
| upcast_choices | Casts a trait reference into a reference to one of its super
traits; returns |
| vtable_methods | Given a trait |
Type Definitions
| CanonicalChalkEnvironmentAndGoal | |
| EvaluationCache | |
| NormalizedTy | |
| PredicateObligation | |
| PredicateObligations | |
| Selection | |
| SelectionCache | |
| SelectionResult | When performing resolution, it is typically the case that there can be one of three outcomes: |
| Supertraits | |
| TraitObligation |