Expand description
An interpreter for MIR used in CTFE and by miri.
Modules§
- allocation 🔒
- The virtual memory representation of the MIR interpreter.
- error 🔒
- pointer 🔒
- queries 🔒
- value 🔒
Macros§
- err_exhaust 
- err_inval 
- err_machine_ stop 
- err_ub
- err_ub_ custom 
- err_ub_ format 
- err_unsup 
- err_unsup_ format 
- throw_exhaust 
- throw_inval 
- throw_machine_ stop 
- throw_ub 
- throw_ub_ custom 
- throw_ub_ format 
- throw_unsup 
- throw_unsup_ format 
Structs§
- AllocDecoding Session 
- AllocDecoding State 
- AllocId
- AllocMap 🔒
- AllocRange 
- The information that makes up a memory access: offset and size.
- Allocation
- This type represents an Allocation in the Miri/CTFE core engine.
- BadBytesAccess 
- Details of an access to uninitialized bytes / bad pointer bytes where it is not allowed.
- ConstAllocation 
- Interned types generally have an Outertype and anInnertype, whereOuteris a newtype aroundInterned<Inner>, and all the operations are done onOuter, because all occurrences are interned. E.g.Tyis an outer type andTyKindis its inner type.
- CtfeProvenance 
- The type of provenance in the compile-time interpreter. This is a packed representation of:
- GlobalId 
- Uniquely identifies one of the following:
- InitChunk Iter 
- Yields InitChunks. SeeInitMask::range_as_init_chunks.
- InterpError Info 
- 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 .into()on anInterpError. Inrustc_mir::interpret, we havethrow_err_*macros for this.
- InterpResult 
- The result type used by the interpreter. This is a newtype around Resultto block access to operations likeok()that discard UB errors.
- LitToConst Input 
- Input argument for tcx.lit_to_const.
- Misalignment
- Information about a misaligned pointer.
- Pointer
- Represents a pointer in the Miri engine.
- ReportedError Info 
- ScalarSize Mismatch 
- Information about a size mismatch.
- ValidationError Info 
Enums§
- AllocDiscriminant 🔒
- AllocError 
- We have our own error type that does not know about the AllocId; that information is added when converting toInterpError.
- AllocInit 
- Whether a new allocation should be initialized with zero-bytes.
- CheckAlign Msg 
- Details of which pointer is not aligned.
- CheckInAlloc Msg 
- Details of why a pointer had to be in-bounds.
- ErrorHandled 
- ExpectedKind 
- GlobalAlloc 
- 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.
- InitChunk 
- A contiguous chunk of initialized or uninitialized memory.
- InterpError Kind 
- InvalidMeta Kind 
- InvalidProgram Info 
- Error information for when the program we executed turned out not to actually be a valid program. This cannot happen in stand-alone Miri (except for layout errors that are only detect during monomorphization), but it can happen during CTFE/ConstProp where we work on generic code or execution does not have all information available.
- PointerKind 
- ResourceExhaustion Info 
- Error information for when the program exhausted the resources granted to it by the interpreter.
- Scalar
- A Scalarrepresents an immediate, primitive value existing outside of amemory::Allocation. It is in many ways like a small chunk of anAllocation, up to 16 bytes in size. Like a range of bytes in anAllocation, aScalarcan either represent the raw bytes of a simple value or a pointer into anotherAllocation
- State 🔒
- UndefinedBehavior Info 
- Error information for when the program caused Undefined Behavior.
- UnsupportedOpInfo 
- 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.
- ValTreeCreation Error 
- An error type for the const_to_valtreequery. Some error should be reported with a “use-site span”, which means the query cannot emit the error, so those errors are represented as dedicated variants here.
- ValidationError Kind 
Constants§
Traits§
- AllocBytes 
- Functionality required for the bytes of an Allocation.
- MachineStop Type 
- A trait for machine-specific errors (or other “machine stop” conditions).
- PointerArithmetic 
- Provenance
- This trait abstracts over the kind of provenance that is associated with a Pointer. It is mostly opaque; theMachinetrait extends it with some more operations that also have access to some global state. TheDebugrendering is used to display bare provenance, and for the default impl offmt.
Functions§
- alloc_range 
- Free-starting constructor for less syntactic overhead.
- interp_ok 
- read_target_ uint 
- specialized_encode_ alloc_ id 
- write_target_ uint