Crate miri

Source

Re-exports§

pub use rustc_const_eval::interpret;
pub use rustc_const_eval::interpret::AllocMap;
pub use rustc_const_eval::interpret::Provenance as _;
pub use crate::alloc_addresses::EvalContextExt as _;
pub use crate::borrow_tracker::stacked_borrows::EvalContextExt as _;
pub use crate::borrow_tracker::tree_borrows::EvalContextExt as _;
pub use crate::borrow_tracker::EvalContextExt as _;
pub use crate::concurrency::data_race::EvalContextExt as _;
pub use crate::concurrency::init_once::EvalContextExt as _;
pub use crate::concurrency::sync::EvalContextExt as _;
pub use crate::concurrency::thread::EvalContextExt as _;
pub use crate::diagnostics::EvalContextExt as _;
pub use crate::helpers::EvalContextExt as _;
pub use crate::intrinsics::EvalContextExt as _;
pub use crate::operator::EvalContextExt as _;
pub use crate::provenance_gc::EvalContextExt as _;
pub use crate::shims::env::EvalContextExt as _;
pub use crate::shims::foreign_items::EvalContextExt as _;
pub use crate::shims::io_error::EvalContextExt as _;
pub use crate::shims::io_error::LibcError;
pub use crate::shims::os_str::EvalContextExt as _;
pub use crate::shims::panic::EvalContextExt as _;
pub use crate::shims::time::EvalContextExt as _;
pub use rustc_const_eval::interpret::*;

Modules§

alloc_addresses 🔒
This module is responsible for managing the absolute addresses that allocations are located at, and for casting between pointers and integers based on those addresses.
alloc_bytes 🔒
borrow_tracker 🔒
clock 🔒
concurrency 🔒
diagnostics 🔒
eval 🔒
Main evaluator loop and setting up the initial stack frame.
helpers 🔒
intrinsics 🔒
machine 🔒
Global machine state as well as implementation of the interpreter engine Machine trait.
math 🔒
mono_hash_map 🔒
This is a “monotonic FxHashMap”: A FxHashMap that, when shared, can be pushed to but not otherwise mutated. We also box items in the map. This means we can safely provide shared references into existing items in the FxHashMap, because they will not be dropped (from being removed) or moved (because they are boxed). The API is completely tailored to what memory.rs needs. It is still in a separate file to minimize the amount of code that has to care about the unsafety.
operator 🔒
provenance_gc 🔒
range_map 🔒
Implements a map from integer indices to data. Rather than storing data for every index, internally, this maps entire ranges to the data. To this end, the APIs all work on ranges, not on individual integers. Ranges are split as necessary (e.g., when [0,5) is first associated with X, and then [1,2) is mutated). Users must not depend on whether a range is coalesced or not, even though this is observable via the iteration APIs.
shims 🔒

Macros§

callback
Creates a DynMachineCallback:

Structs§

AllocExtra
Extra per-allocation data
BorTag
Tracking pointer provenance
CatchUnwindData
Holds all of the relevant data for when unwinding hits a try frame.
Clock
A monotone clock used for Instant simulation.
CondvarId
0 is used to indicate that the id was not yet assigned and, therefore, is not a valid identifier.
DynSym
Type of dynamic symbols (for dlsym et al)
FrameExtra
Extra data stored with each stack frame
InitOnceId
0 is used to indicate that the id was not yet assigned and, therefore, is not a valid identifier.
Instant
Item
An item in the per-location borrow stack.
LiveAllocs
MiriAllocBytes
Allocation bytes that explicitly handle the layout of the data they’re storing. This is necessary to interface with native code that accesses the program store in Miri.
MiriConfig
Configuration needed to spawn a Miri instance.
MiriMachine
The machine itself.
MonoHashMap
MutexRef
PrimitiveLayouts
Precomputed layouts of primitive types
RangeMap
RwLockId
0 is used to indicate that the id was not yet assigned and, therefore, is not a valid identifier.
Stack
Extra per-location state.
Stacks
Extra per-allocation state.
SynchronizationObjects
The state of all synchronization objects.
ThreadId
A thread identifier.
ThreadManager
A set of threads.
TlsData
Tree
Tree structure with both parents and children since we want to be able to traverse the tree efficiently in both directions.

Enums§

AccessKind
Indicates which kind of access is being performed.
AlignmentCheck
AtomicFenceOrd
Valid atomic fence orderings, subset of atomic::Ordering.
AtomicReadOrd
Valid atomic read orderings, subset of atomic::Ordering.
AtomicRwOrd
Valid atomic read-write orderings, alias of atomic::Ordering (not non-exhaustive).
AtomicWriteOrd
Valid atomic write orderings, subset of atomic::Ordering.
BacktraceStyle
BlockReason
Keeps track of what the thread is blocked on.
BorrowTrackerMethod
Which borrow tracking method to use
EmulateItemResult
What needs to be done after emulating an item (a shim or an intrinsic) is done.
EnvVars
IoError
A representation of an IO error: either a libc error name, or a host error.
IsolatedOp
MiriEntryFnType
MiriMemoryKind
Extra memory kinds
NonHaltingDiagnostic
Miri specific diagnostics
Permission
Indicates which permission is granted (by this item to some pointers)
Provenance
Pointer provenance.
ProvenanceExtra
The “extra” information a pointer has over a regular AllocId.
ProvenanceMode
RejectOpWith
RetagFields
Policy on whether to recurse into fields to retag
TerminationInfo
Details of premature program termination.
TimeoutAnchor
Whether the timeout is relative or absolute.
TimeoutClock
The clock to use for the timeout you are asking for.
UnblockKind
The argument type for the “unblock” callback, indicating why the thread got unblocked.
ValidationMode

Constants§

MAX_CPUS
The maximum number of CPUs supported by miri.
MIRI_DEFAULT_ARGS
Insert rustc arguments at the beginning of the argument list that Miri wants to be set per default, for maximal validation power. Also disable the MIR pass that inserts an alignment check on every pointer dereference. Miri does that too, and with a better error message.

Traits§

MachineCallback
Trait for callbacks handling asynchronous machine operations.
MiriInterpCxExt
A little trait that’s useful to be inherited by extension traits.
VisitProvenance

Functions§

create_ecx
Returns a freshly created InterpCx. Public because this is also used by priroda.
eval_entry
Evaluates the entry function specified by entry_id. Returns Some(return_code) if program execution completed. Returns None if an evaluation error occurred.
report_error
Emit a custom diagnostic without going through the miri-engine machinery.

Type Aliases§

DynMachineCallback
Type alias for boxed machine callbacks with generic argument type.
DynUnblockCallback
Type alias for unblock callbacks, i.e. machine callbacks invoked when a thread gets unblocked.
ImmTy
MPlaceTy
MemoryKind
MiriInterpCx
A rustc InterpCx for Miri.
OpTy
PlaceTy
Pointer
Scalar
StackEmptyCallback
StrictPointer
VisitWith