Crate rustc_middle[][src]

Expand description

The “main crate” of the Rust compiler. This crate contains common type definitions that are used by the other crates in the rustc “family”. Some prominent examples (note that each of these modules has their own README with further details).

  • HIR. The “high-level (H) intermediate representation (IR)” is defined in the hir module.
  • MIR. The “mid-level (M) intermediate representation (IR)” is defined in the mir module. This module contains only the definition of the MIR; the passes that transform and operate on MIR are found in rustc_const_eval crate.
  • Types. The internal representation of types used in rustc is defined in the ty module. This includes the type context (or tcx), which is the central context during most of compilation, containing the interners and other things.

For more information about how rustc works, see the rustc dev guide.

Note

This API is completely unstable and subject to change.

Modules

HIR datatypes. See the rustc dev guide for more info.

MIR datatypes and passes. See the rustc dev guide for more info.

THIR datatypes and definitions. See the rustc dev guide for more info.

Trait Resolution. See the rustc dev guide for more information on how this works.

Defines how the compiler represents types internally.

Macros

Used for types that are Copy and which do not care arena allocated data (i.e., don’t need to be folded).

This declares a list of types which can be allocated by Arena.