Crate ra_ap_hir_ty[][src]

The type system. We currently use this to infer types for completion, hover information and various assists.

Re-exports

pub use traits::TraitEnvironment;

Modules

db

The home of HirDatabase, which is the Salsa database containing all the type inference-related queries.

diagnostics

Type inference-based diagnostics.

display

The HirDisplay trait, which serves two purposes: Turning various bits from HIR back into source code, and just displaying them for debugging/testing purposes.

method_resolution

This module is concerned with finding methods that a given type provides. For details about how this works in rustc, see the method lookup page in the rustc guide and the corresponding code mostly in librustc_typeck/check/method/probe.rs.

primitive

A few helper functions for dealing with primitives.

traits

Trait solving using Chalk.

Macros

has_interner

Structs

AdtId

The id for an Abstract Data Type (i.e. structs, unions and enums).

BoundVar

Identifies a particular bound variable within a binder. Variables are identified by the combination of a DebruijnIndex, which identifies the binder, and an index within that binder.

CallableSig

A function signature as seen by type inference: Several parameter types and one return type.

DebruijnIndex

References the binder at the given depth. The index is a de Bruijn index, so it counts back through the in-scope binders, with 0 being the innermost binder. This is used in impls and the like. For example, if we had a rule like for<T> { (T: Clone) :- (T: Copy) }, then T would be represented as a BoundVar(0) (as the for is the innermost binder).

FnSubst

A wrapper for the substs on a Fn.

InferenceResult

The result of type inference: A mapping from expressions and patterns to types.

Interner
ReturnTypeImplTraits
TyBuilder

This is a builder for Ty or anything that needs a Substitution.

TyLoweringContext

Enums

CallableDefId
ImplTraitId
ImplTraitLoweringMode
Mutability

Whether a type is mutable or not.

Safety

Whether a function is safe or not.

Scalar

Types of scalar values.

TyDefId
TyVariableKind

Represents some extra knowledge we may have about the type variable.

ValueTyDefId

Traits

Cast

The Cast trait is used to make annoying upcasts between logically equivalent types that imply wrappers. For example, one could convert a DomainGoal into a Goal by doing:

ProjectionTyExt
TraitRefExt
TyExt
TypeWalk

This allows walking structures that contain types to do something with those types, similar to Chalk’s Fold trait.

Functions

all_super_traits

Returns an iterator over the whole super trait hierarchy (including the trait itself).

associated_type_shorthand_candidates
autoderef
callable_item_sig

Build the signature of a callable item (function, struct or enum variant).

const_from_placeholder_idx
could_unify
dummy_usize_const
from_assoc_type_id
from_chalk_trait_id
from_foreign_def_id
from_placeholder_idx
lt_from_placeholder_idx
make_canonical
param_idx

Return an index of a parameter in the generic type parameter list by it’s id.

static_lifetime
subst_prefix
to_assoc_type_id
to_chalk_trait_id
to_foreign_def_id
to_placeholder_idx

Type Definitions

AliasEq
AliasTy
AssocTypeId
Binders
Canonical
CanonicalVarKinds
ChalkTraitId
ClosureId
ConcreteConst
Const
ConstData
ConstValue
ConstrainedSubst
DomainGoal
DynTy
FnDefId
FnPointer
FnSig
ForeignDefId
GenericArg
GenericArgData
Guidance
InEnvironment
InferenceVar
Lifetime
LifetimeData
LifetimeOutlives
OpaqueTy
OpaqueTyId
PlaceholderIndex
PolyFnSig

A polymorphic function signature.

ProjectionTy
QuantifiedWhereClause
QuantifiedWhereClauses
Solution
Substitution
TraitRef
Ty
TyKind
VariableKind
VariableKinds
WhereClause