[][src]Module rustc::mir::interpret

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

An interpreter for MIR used in CTFE and by miri.

Modules

allocationInternal

The virtual memory representation of the MIR interpreter.

errorInternal
pointerInternal
queriesInternal
valueInternal

Structs

AllocDecodingSessionInternal
AllocDecodingStateInternal
AllocIdInternal
AllocMapInternal
AllocationInternal
ConstEvalErrInternal
FrameInfoInternal
GlobalIdInternal

Uniquely identifies one of the following:

InterpErrorInfoInternal

Packages the kind of error we got from the const code interpreter up with a Rust-level backtrace of where the error occurred. Thsese should always be constructed by calling .into() on a InterpError. In librustc_mir::interpret, we have throw_err_* macros for this.

LitToConstInputInternal

Input argument for tcx.lit_to_const.

PointerInternal

Pointer is generic over the type that represents a reference to Allocations, thus making it possible for the most convenient representation to be used in each context.

RawConstInternal

Represents the result of a raw const operation, pre-validation.

RelocationsInternal

Relocations.

UndefMaskInternal

A bitmask where each bit refers to the byte with the same index. If the bit is true, the byte is defined. If it is false the byte is undefined.

Enums

AllocDiscriminantInternal
CheckInAllocMsgInternal

Used by check_in_alloc to indicate context of check

ConstValueInternal

Represents a constant value in Rust. Scalar and Slice are optimizations for array length computations, enum discriminants and the pattern matching logic.

ErrorHandledInternal
GlobalAllocInternal

An allocation in the global (tcx-managed) memory can be either a function pointer, a static, or a "real" allocation with some data in it.

InterpErrorInternal
InvalidProgramInfoInternal

Error information for when the program we executed turned out not to actually be a valid program. This cannot happen in stand-alone Miri, but it can happen during CTFE/ConstProp where we work on generic code or execution does not have all information available.

LitToConstErrorInternal

Error type for tcx.lit_to_const.

ResourceExhaustionInfoInternal

Error information for when the program exhausted the resources granted to it by the interpreter.

ScalarInternal

A Scalar represents an immediate, primitive value existing outside of a memory::Allocation. It is in many ways like a small chunk of a Allocation, up to 8 bytes in size. Like a range of bytes in an Allocation, a Scalar can either represent the raw bytes of a simple value or a pointer into another Allocation

ScalarMaybeUndefInternal
StateInternal
UndefinedBehaviorInfoInternal

Error information for when the program caused Undefined Behavior.

UnsupportedOpInfoInternal

Error information for when the program did something that might (or might not) be correct to do according to the Rust spec, but due to limitations in the interpreter, the operation could not be carried out. These limitations can differ between CTFE and the Miri engine, e.g., CTFE does not support casting pointers to "real" integers.

Traits

AllocationExtraInternal
PointerArithmeticInternal

Functions

get_slice_bytesInternal

Gets the bytes of a constant slice value.

read_target_uintInternal
sign_extendInternal

Truncates value to size bits and then sign-extend it to 128 bits (i.e., if it is negative, fill with 1's on the left).

specialized_encode_alloc_idInternal
struct_errorInternal
truncateInternal

Truncates value to size bits.

write_target_uintInternal

Type Definitions

ConstEvalRawResultInternal
ConstEvalResultInternal
DecodingSessionIdInternal
InterpResultInternal