Skip to main content

Module lower

Module lower 

Source
Expand description

Methods for lowering the HIR to types. There are two main cases here:

  • Lowering a type reference like &usize or Option<foo::bar::Baz> to a type: The entry point for this is TyLoweringContext::lower_ty.
  • Building the type for an item: This happens through the ty query.

This usually involves resolving names, collecting generic arguments etc.

Modulesยง

diagnostics ๐Ÿ”’
This files contains the declaration of diagnostics kinds for ty and path lowering.
path ๐Ÿ”’
A wrapper around TyLoweringContext specifically for lowering paths.

Structsยง

FieldType
GenericDefaults
GenericDefaultsRef
GenericPredicates
ImplTrait
ImplTraitLoweringState ๐Ÿ”’
ImplTraits
PathDiagnosticCallbackData ๐Ÿ”’
SupertraitsInfo ๐Ÿ”’
TrackedStructToken ๐Ÿ”’
A token that is required to construct tracked structs. This exists to prevent one from accidentally creating a tracked struct outside of a query which may happen for some codepaths.
TyLoweringContext
TyLoweringResult
TyLoweringResultInfo ๐Ÿ”’
TypeAliasBounds

Enumsยง

AssocTypeShorthandResolution ๐Ÿ”’
ForbidParamsAfterReason ๐Ÿ”’
GenericPredicateSource ๐Ÿ”’
ImplTraitLoweringMode ๐Ÿ”’
LifetimeElisionKind
LifetimeLoweringMode
LoweringMode
TyDefId
ValueTyDefId

Traitsยง

TyLoweringInferVarsCtx

Functionsยง

associated_ty_item_bounds ๐Ÿ”’
associated_type_by_name_including_super_traits_allow_ambiguity ๐Ÿ”’
callable_item_signature ๐Ÿ”’
Build the signature of a callable item (function, struct or enum variant).
callable_item_signature_with_diagnostics ๐Ÿ”’
const_param_ty ๐Ÿ”’
const_param_types ๐Ÿ”’
const_param_types_with_diagnostics ๐Ÿ”’
const_param_types_with_diagnostics_cycle_result ๐Ÿ”’
field_types_query ๐Ÿ”’
field_types_with_diagnostics ๐Ÿ”’
Build the type of all specific fields of a struct or enum variant.
fn_sig_for_enum_variant_constructor ๐Ÿ”’
fn_sig_for_fn ๐Ÿ”’
fn_sig_for_struct_constructor ๐Ÿ”’
generic_defaults ๐Ÿ”’
generic_defaults_with_diagnostics ๐Ÿ”’
Resolve the default type params from generics.
generic_defaults_with_diagnostics_cycle_result ๐Ÿ”’
generic_predicates ๐Ÿ”’
Resolve the where clause(s) of an item with generics, with a given filter
generic_predicates_cycle_result ๐Ÿ”’
A cycle can occur from malformed code.
impl_self_ty_query ๐Ÿ”’
impl_self_ty_with_diagnostics ๐Ÿ”’
impl_self_ty_with_diagnostics_cycle_result ๐Ÿ”’
impl_trait_query ๐Ÿ”’
impl_trait_with_diagnostics ๐Ÿ”’
lower_mutability ๐Ÿ”’
param_env_from_predicates ๐Ÿ”’
push_const_arg_has_type_predicates ๐Ÿ”’
replace_dummy_self_with_error ๐Ÿ”’
resolve_type_param_assoc_type_shorthand ๐Ÿ”’
Predicates for param_id of the form P: SomeTrait. If assoc_name is provided, only return predicates referencing traits that have an associated type of that name.
resolve_type_param_assoc_type_shorthand_cycle_result ๐Ÿ”’
trait_environment ๐Ÿ”’
ty_query ๐Ÿ”’
Build the declared type of an item. This depends on the namespace; e.g. for struct Foo(usize), we have two types: The type of the struct itself, and the constructor function (usize) -> Foo which lives in the values namespace.
type_alias_bounds ๐Ÿ”’
type_alias_bounds_with_diagnostics ๐Ÿ”’
type_alias_self_bounds ๐Ÿ”’
type_for_adt ๐Ÿ”’
type_for_const ๐Ÿ”’
type_for_const_with_diagnostics ๐Ÿ”’
Build the declared type of a const.
type_for_enum_variant_constructor ๐Ÿ”’
Build the type of a tuple enum variant constructor.
type_for_fn ๐Ÿ”’
Build the declared type of a function. This should not need to look at the function body.
type_for_static ๐Ÿ”’
type_for_static_with_diagnostics ๐Ÿ”’
Build the declared type of a static.
type_for_struct_constructor ๐Ÿ”’
Build the type of a tuple struct constructor.
type_for_type_alias_with_diagnostics ๐Ÿ”’
type_for_type_alias_with_diagnostics_cycle_result ๐Ÿ”’
value_ty ๐Ÿ”’

Type Aliasesยง

ImplTraitIdx