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”. The following are some prominent examples.
- HIR. The “high-level (H) intermediate representation (IR)” is
defined in the
hirmodule. - THIR. The “typed high-level (H) intermediate representation (IR)”
is defined in the
thirmodule. - MIR. The “mid-level (M) intermediate representation (IR)” is
defined in the
mirmodule. This module contains only the definition of the MIR; the passes that transform and operate on MIR are found inrustc_const_evalcrate. - Types. The internal representation of types used in rustc is
defined in the
tymodule. This includes the type context (ortcx), 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§
- arena
- Declares
rustc_middle::arena::Arena, which can allocate values of anyCopytype, and any!Copytype explicitly listed below. - dep_
graph - diagnostics
- hir
- HIR datatypes. See the rustc dev guide for more info.
- hooks
- “Hooks” let you write
tcxmethods in downstream crates and call them in this crate, reducing the amount of code that needs to be in this crate (which is already very big). This is somewhat similar to queries, but queries come with a lot of machinery for caching and incremental compilation, whereas hooks are just plain function pointers without any of the query magic. - ich
- infer
- lint
- macros 🔒
- middle
- mir
- MIR datatypes and passes. See the rustc dev guide for more info.
- mono
- ptrauth
- queries
- The rustc Query System: Query Definitions and Modifiers
- query
- thir
- THIR datatypes and definitions. See the rustc dev guide for more info.
- traits
- Trait Resolution. See the rustc dev guide for more information on how this works.
- ty
- Defines how the compiler represents types internally.
- util
- verify_
ich