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_mir 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

arena
dep_graph
hir

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

ich

ICH - Incremental Compilation Hash

infer
lint
macros
middle
mir

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

query
thir
traits

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

ty

Defines how the compiler represents types internally.

util

Macros

CloneLiftImpls
EnumTypeFoldableImpl
TrivialTypeFoldableAndLiftImpls
TrivialTypeFoldableImpls

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

__impl_decoder_methods
arena_types

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

bug
err_exhaust
err_inval
err_machine_stop
err_ub
err_ub_format
err_unsup
err_unsup_format
implement_ty_decoder
make_dep_kind_array
rustc_cached_queries
rustc_query_append
rustc_query_description
span_bug
throw_exhaust
throw_inval
throw_machine_stop
throw_ub
throw_ub_format
throw_unsup
throw_unsup_format