[][src]Module rustc_mir_build::thir

The MIR is built from some typed high-level IR (THIR). This section defines the THIR along with a trait for accessing it. The intention is to allow MIR construction to be unit-tested and separated from the Rust source and compiler data structures.

Modules

constant
cx

This module contains the functionality to convert from the wacky tcx data structures into the THIR. The builder is generally ignorant of the tcx, etc., and instead goes through the Cx for most of its work.

pattern

Validation of patterns/matches.

util

Structs

Arm
Block
Expr

The Thir trait implementor lowers their expressions (&'tcx H::Expr) into instances of this Expr enum. This lowering can be done basically as lazily or as eagerly as desired: every recursive reference to an expression in this enum is an ExprRef<'tcx>, which may in turn be another instance of this enum (boxed), or else an unlowered &'tcx H::Expr. Note that instances of Expr are very short-lived. They are created by Thir::to_expr, analyzed and converted into MIR, and then discarded.

FieldExprRef
FruInfo
Stmt

Enums

BlockSafety
ExprKind
ExprRef
Guard
InlineAsmOperand
LintLevel
LogicalOp
StmtKind
StmtRef

Traits

Mirror

"Mirroring" is the process of converting from a HIR type into one of the THIR types defined in this file. This is basically a "on the fly" desugaring step that hides a lot of the messiness in the tcx. For example, the mirror of a &'tcx hir::Expr is an Expr<'tcx>.