Module rustc_middle::source ·
An interpreter for MIR used in CTFE and by miri.
- AllocMap 🔒
- The information that makes up a memory access: offset and size.
- This type represents an Allocation in the Miri/CTFE core engine.
- Represents the result of const evaluation via the
- Interned types generally have an
Outertype and an
Outeris a newtype around
Interned<Inner>, and all the operations are done on
Outer, because all occurrences are interned. E.g.
Tyis an outer type and
TyKindis its inner type.
- Uniquely identifies one of the following:
- Packages the kind of error we got from the const code interpreter up with a Rust-level backtrace of where the error occurred. These should always be constructed by calling
rustc_mir::interpret, we have
throw_err_*macros for this.
- Input argument for
- Represents a pointer in the Miri engine.
- Information about a size mismatch.
- Details of an access to uninitialized bytes where it is not allowed.
- We have our own error type that does not know about the
AllocId; that information is added when converting to
- Details of why a pointer had to be in-bounds.
- Represents a constant value in Rust.
Sliceare optimizations for array length computations, enum discriminants and the pattern matching logic.
- 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.
- A contiguous chunk of initialized or uninitialized memory.
- 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.
- Error type for
- Error information for when the program exhausted the resources granted to it by the interpreter.
Scalarrepresents an immediate, primitive value existing outside of a
memory::Allocation. It is in many ways like a small chunk of an
Allocation, up to 16 bytes in size. Like a range of bytes in an
Scalarcan either represent the raw bytes of a simple value or a pointer into another
- State 🔒
- Error information for when the program caused Undefined Behavior.
- 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 dereferencing pointers at integral addresses.
- Functionality required for the bytes of an
- A trait for machine-specific errors (or other “machine stop” conditions).
- This trait abstracts over the kind of provenance that is associated with a
Pointer. It is mostly opaque; the
Machinetrait extends it with some more operations that also have access to some global state. The
Debugrendering is used to distplay bare provenance, and for the default impl of
- Free-starting constructor for less syntactic overhead.
- Gets the bytes of a constant slice value.