rustc_infer

Module traits

Source
Expand description

Trait Resolution. See the rustc-dev-guide for more information on how this works.

Re-exports§

Modules§

  • engine 🔒
  • project 🔒
    Code for projecting associated types out of trait references.
  • 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 rustc_traits.
  • Candidate selection. See the rustc dev guide for more information on how this works.

Structs§

  • Identifies a particular impl in the source, along with a set of generic parameters from the impl’s type/lifetime parameters. The nested vector corresponds to the nested obligations attached to the impl’s type parameters.
  • An Obligation represents some trait reference (e.g., i32: Eq) for which the “impl_source” must be found. The process of finding an “impl_source” is called “resolving” the Obligation. This process consists of either identifying an impl (e.g., impl Eq for i32) that satisfies the obligation, or else finding a bound that is in scope. The eventual result is usually a Selection (defined below).
  • The reason why we incurred this obligation; used for error reporting.
  • Information about the origin expression of a pattern, relevant to diagnostics. Fields here refer to the scrutinee of a pattern. If the scrutinee isn’t given in the diagnostic, then this won’t exist.
  • 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.

Enums§

Traits§

Type Aliases§