[][src]Module rustc_mir::interpret

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

An interpreter for MIR used in CTFE and by miri

Re-exports

pub use const_eval::eval_promoted;
pub use const_eval::mk_borrowck_eval_cx;
pub use const_eval::mk_eval_cx;
pub use const_eval::CompileTimeEvaluator;
pub use const_eval::const_to_allocation_provider;
pub use const_eval::const_eval_provider;
pub use const_eval::const_field;
pub use const_eval::const_variant_index;
pub use const_eval::op_to_const;

Modules

cast [
Experimental
]
eval_context [
Experimental
]
intrinsics [
Experimental
]

Intrinsics and other functions that the miri engine executes without looking at their MIR. Intrinsics/functions supported here are shared by CTFE and miri.

machine [
Experimental
]

This module contains everything needed to instantiate an interpreter. This separation exists to ensure that no fancy miri features like interpreting common C functions leak into CTFE.

memory [
Experimental
]

The memory subsystem.

operand [
Experimental
]

Functions concerning immediate values and operands, and reading from operands. All high-level functions to read from memory work on operands as sources.

operator [
Experimental
]
place [
Experimental
]

Computations on places -- field projections, going from mir::Place, and writing into a place. All high-level functions to write to memory work on places as destinations.

snapshot [
Experimental
]

This module contains the machinery necessary to detect infinite loops during const-evaluation by taking snapshots of the state of the interpreter at regular intervals.

step [
Experimental
]

This module contains the EvalContext methods for executing a single step of the interpreter.

terminator [
Experimental
]
traits [
Experimental
]
validity [
Experimental
]

Structs

EvalContext [
Experimental
]
Frame [
Experimental
]

A stack frame.

MPlaceTy [
Experimental
]

A MemPlace with its layout. Constructing it is only possible in this module.

MemPlace [
Experimental
]
Memory [
Experimental
]
OpTy [
Experimental
]
PlaceTy [
Experimental
]
ValTy [
Experimental
]

Enums

LocalValue [
Experimental
]
MemoryKind [
Experimental
]
Operand [
Experimental
]

An Operand is the result of computing a mir::Operand. It can be immediate, or still in memory. The latter is an optimization, to delay reading that chunk of memory and to avoid having to store arbitrary-sized data here.

Place [
Experimental
]
StackPopCleanup [
Experimental
]
Value [
Experimental
]

A Value represents a single immediate self-contained Rust value.

Traits

Machine [
Experimental
]

Methods of this trait signifies a point where CTFE evaluation would fail and some use case dependent behaviour can instead be applied