Expand description
Methods for lowering the HIR to types. There are two main cases here:
- Lowering a type reference like
&usizeorOption<foo::bar::Baz>to a type: The entry point for this isTyLoweringContext::lower_ty. - Building the type for an item: This happens through the
tyquery.
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
TyLoweringContextspecifically for lowering paths.
Structsยง
- Field
Type - Generic
Defaults - Generic
Defaults Ref - Generic
Predicates - Impl
Trait - Impl
Trait ๐Lowering State - Impl
Traits - Path
Diagnostic ๐Callback Data - Supertraits
Info ๐ - Tracked
Struct ๐Token - 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.
- TyLowering
Context - TyLowering
Result - TyLowering
Result ๐Info - Type
Alias Bounds
Enumsยง
- Assoc
Type ๐Shorthand Resolution - Forbid
Params ๐After Reason - Generic
Predicate ๐Source - Impl
Trait ๐Lowering Mode - Lifetime
Elision Kind - Lifetime
Lowering Mode - Lowering
Mode - TyDefId
- Value
TyDef Id
Traitsยง
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_idof the formP: SomeTrait. Ifassoc_nameis 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) -> Foowhich 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 ๐