Crate ra_ap_hir_def[][src]

hir_def crate contains everything between macro expansion and type inference.

It defines various items (structs, enums, traits) which comprises Rust code, as well as an algorithm for resolving paths to such entities.

Note that hir_def is a work in progress, so not all of the above is actually true.

Modules

adt

Defines hir-level representation of structs, enums and unions

attr

A higher level attributes based on TokenTree, with also some shortcuts.

body

Defines Body: a lowered representation of bodies of functions, statics and consts.

builtin_attr

Builtin attributes resolved by nameres.

builtin_type

This module defines built-in types.

child_by_source

When constructing hir, we start at some parent syntax node and recursively lower the children.

data

Contains basic data about various HIR declarations.

db

Defines database & queries for name resolution.

diagnostics

Diagnostics produced by hir_def.

dyn_map

This module defines a DynMap – a container for heterogeneous maps.

expr

This module describes hir-level representation of expressions.

find_path

An algorithm to find a path to refer to a certain item.

generics

Many kinds of items or constructs can have generic parameters: functions, structs, impls, traits, etc. This module provides a common HIR for these generic parameters. See also the Generics type and the generics_of query in rustc.

import_map

A map of all publicly exported items in a crate.

item_scope

Describes items defined or visible (ie, imported) in a certain scope. This is shared between modules and blocks.

item_tree

A simplified AST that only contains items.

keys

keys to be used with DynMap

lang_item

Collects lang items: items marked with #[lang = "..."] attribute.

nameres

This module implements import-resolution/macro expansion algorithm.

path

A desugared representation of paths like crate::foo or <Type as Trait>::bar.

per_ns

In rust, it is possible to have a value, a type and a macro with the same name without conflicts.

resolver

Name resolution façade.

src

Utilities for mapping between hir IDs and the surface syntax.

type_ref

HIR for references to types. Paths in these are not yet resolved. They can be directly created from an ast::TypeRef, without further queries.

visibility

Defines hir-level representation of visibility (e.g. pub and pub(crate)).

Macros

__known_path
__path

Structs

AssocItemLoc
BlockId
BlockLoc
ConstId
ConstParamId
EnumId
EnumVariantId
FieldId
FunctionId
ImplId
ItemLoc
LifetimeParamId
ModuleId
StaticId
StructId
TraitId
TypeAliasId
TypeParamId
UnionId
UnresolvedMacro

Enums

AdtId

A Data Type

AssocContainerId
AssocItemId
AttrDefId
DefWithBodyId

The defs which have a body.

GenericDefId
GenericParamId

A generic param

ModuleDefId

The defs which can be visible in the module.

VariantId

Traits

AsMacroCall

A helper trait for converting to MacroCallId

HasModule
Lookup

Type Definitions

EnumLoc
LocalConstParamId
LocalEnumVariantId
LocalFieldId
LocalLifetimeParamId
LocalModuleId

An ID of a module, local to a specific crate

LocalTypeParamId
StaticLoc
TraitLoc
UnionLoc