Crate hir_def

source
Expand description

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.

Re-exports§

  • pub use self::hir::type_ref;
  • pub use rustc_abi as layout;
  • pub use rustc_abi as layout;
  • pub use rustc_abi as layout;

Modules§

  • A higher level attributes based on TokenTree, with also some shortcuts.
  • Defines Body: a lowered representation of bodies of functions, statics and consts.
  • This module defines built-in types.
  • Contains basic data about various HIR declarations.
  • Defines database & queries for name resolution.
  • This module defines a DynMap – a container for heterogeneous maps.
  • Macro expansion utilities.
  • An algorithm to find a path to refer to a certain item.
  • 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.
  • This module describes hir-level representation of expressions.
  • A map of all publicly exported items in a crate.
  • Describes items defined or visible (ie, imported) in a certain scope. This is shared between modules and blocks.
  • A simplified AST that only contains items.
  • Collects lang items: items marked with #[lang = "..."] attribute.
  • Context for lowering paths.
  • This module implements import-resolution/macro expansion algorithm.
  • A desugared representation of paths like crate::foo or <Type as Trait>::bar.
  • In rust, it is possible to have a value, a type and a macro with the same name without conflicts.
  • Name resolution façade.
  • Utilities for mapping between hir IDs and the surface syntax.
  • Defines hir-level representation of visibility (e.g. pub and pub(crate)).

Structs§

Enums§

Traits§

  • A helper trait for converting to MacroCallId
  • A thing that we want to store in interned ids, but we don’t know its type in hir-def. This is currently only used in InTypeConstId for storing the type (which has type Ty defined in the hir-ty crate) of the constant in its id, which is a temporary hack so we may want to remove this after removing that.

Type Aliases§