Skip to main content

Crate miri

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::blocking_io::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::helpers::ToU64 as _;
pub use crate::helpers::ToUsize 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::sig::EvalContextExt as _;
pub use crate::shims::time::EvalContextExt as _;
pub use crate::shims::unwind::EvalContextExt as _;
pub use rustc_log::tracing;
pub use rustc_const_eval::interpret::*;

Modules§

alloc 🔒
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.
borrow_tracker 🔒
clock 🔒
concurrency 🔒
data_structures 🔒
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 🔒
native_lib
operator 🔒
provenance_gc 🔒
shims 🔒
sym

Macros§

callback
Creates a DynMachineCallback:
enter_trace_span
Enters a [tracing::info_span] only if the “tracing” feature is enabled, otherwise does nothing. This calls rustc_const_eval::enter_trace_span with MiriMachine as the first argument, which will in turn call MiriMachine::enter_trace_span, which takes care of determining at compile time whether to trace or not (and supposedly the call is compiled out if tracing is disabled). Look at rustc_const_eval::enter_trace_span for complete documentation, examples and tips.
shim_sig
Construct a ShimSig with convenient syntax:
shim_sig_arg
Helper for shim_sig!.
shim_sig_args_sep
Helper for shim_sig!.
bug
A macro for triggering an ICE. Calling bug instead of panicking will result in a nicer error message and should therefore be preferred over panic/unreachable or others.
info
Constructs an event at the info level.
span_bug
A macro for triggering an ICE with a span. Calling span_bug! instead of panicking will result in a nicer error message and point at the code the compiler was compiling when it ICEd. This is the preferred way to trigger ICEs.
trace
Constructs an event at the trace level.

Structs§

AllocExtra
Extra per-allocation data
BlockingIoManager
Manager for managing blocking host I/O in a non-blocking manner. We use [Poll] to poll for new I/O events from the OS for sources registered using this manager.
BlockingIoSourceReadiness
Struct reflecting the readiness of a source file description.
BorTag
Tracking pointer provenance
CatchUnwindData
Holds all of the relevant data for when unwinding hits a try frame.
CondvarRef
DedupRangeMap
DynSym
Type of dynamic symbols (for dlsym et al)
FrameExtra
Extra data stored with each stack frame
GenmcConfig
GenmcCtx
InitOnceRef
Instant
An instant (a fixed moment in time) in Miri’s monotone clock.
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
MonotonicClock
A monotone clock used for Instant simulation.
MutexRef
PrimitiveLayouts
Precomputed layouts of primitive types
RwLockRef
Stack
Extra per-location state.
Stacks
Extra per-allocation state.
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.
TreeBorrowsParams
Parameters that Tree Borrows can take.

Enums§

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.
BlockingIoInterest
An I/O interest for a blocked thread. Note that all threads are always considered to be interested in “error” events.
BorrowTrackerMethod
Which borrow tracking method to use
Deadline
A deadline for some event to occur.
EmulateItemResult
What needs to be done after emulating an item (a shim or an intrinsic) is done.
EnvVars
FloatRoundingErrorMode
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
TerminationInfo
Details of premature program termination.
TimeoutClock
The clock to use for the timeout you are asking for.
TimeoutStyle
Whether the timeout is relative or absolute.
UnblockKind
The argument type for the “unblock” callback, indicating why the thread got unblocked.
ValidationMode
Either
The enum Either with variants Left and Right is a general purpose sum type with two cases.

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.
SourceFileDescription
Trait for file descriptions that contain a mio [Source].
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_result
Report the result of a Miri execution.
run_genmc_mode

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.
FnArg
ImmTy
MPlaceTy
MemoryKind
MiriInterpCx
A rustc InterpCx for Miri.
OpTy
PlaceTy
Pointer
Scalar
StackEmptyCallback
StrictPointer
VisitWith