Skip to main content

Module mir

Module mir 

Source
Expand description

MIR definitions and implementation

Re-exportsΒ§

pub use lower::mir_body_for_closure_query;
pub use lower::mir_body_query;
pub use monomorphization::monomorphized_mir_body_for_closure_query;
pub use monomorphization::monomorphized_mir_body_query;

ModulesΒ§

borrowck πŸ”’
MIR borrow checker, which is used in diagnostics like unused_mut
eval πŸ”’
This module provides a MIR interpreter, which is used in const eval.
lower πŸ”’
This module generates a polymorphic MIR from a hir body
monomorphization πŸ”’
Monomorphization of mir, which is used in mir interpreter and const eval.
pretty πŸ”’
A pretty-printer for MIR.

StructsΒ§

BasicBlock
BorrowckResult
Evaluator
FieldIndex
The index of a field (whether of a struct/enum variant, tuple, or closure). For a struct/enum it converts from and to the LocalFieldId, for a tuple or closure it’s simply the index.
Local
MirBody
Operand
An operand in MIR represents a β€œvalue” in Rust, the definition of which is undecided and part of the memory model. One proposal for a definition of values can be found on UCG.
Place
PlaceRef
PlaceTy
To determine the type of a place, we need to keep track of the variant that has been downcast to, in order to find the correct fields. This type does that.
Projection
ProjectionStorage
Statement
StoredProjection
SwitchTargets
Terminator
VTableMap

EnumsΒ§

AggregateKind
BinOp
BorrowKind
CastKind
MirEvalError
MirLowerError
MirSpan
MutBorrowKind
MutabilityReason
Stores spans which implies that the local should be mutable.
OperandKind
ProjectionElem
Rvalue
StatementKind
TerminatorKind
UnOp

FunctionsΒ§

interpret_mir
lower_body_to_mir
Extracts params from body.params/body.self_param and the callable signature, then delegates to lower_to_mir_with_store.
lower_to_mir_with_store
Parameters
mir_body_for_closure_query
mir_body_query
monomorphized_mir_body_for_closure_query
monomorphized_mir_body_query
pad16
render_const_using_debug_impl
return_slot πŸ”’

Type AliasesΒ§

BasicBlockId
LocalId
PlaceElem πŸ”’