Skip to main content

Module mir_scan

Module mir_scan 

Source

Structs§

Checkpoint
A verification checkpoint in one MIR body.
CheckpointLocation
Stable MIR location for a call terminator inside one function body.
RawPtrDerefInfo
Metadata for a single raw pointer dereference operation found in MIR.
StaticMutAccessInfo
Metadata for a static mut access found in MIR.

Enums§

CheckpointKind
Kind of an unsafe verification checkpoint inside a function body.

Functions§

box_deref_transmute_locals 🔒
Locals that hold the result of the compiler’s safe *box deref lowering (directly, or through copies and pointer casts). The compiler lowers *box to a raw-pointer deref of a pointer produced by casting the box’s inner field to a raw pointer, and that deref is safe by the Box invariant, so it is not a raw-pointer-deref checkpoint.
check_safety
Checks the safety of a function signature.
collect_global_local_pairs
Collects pairs of global static variables and their corresponding local variables within a function’s MIR that are assigned from statics.
collect_raw_ptr_deref_info
Collect all raw pointer dereference operations in def_id as metadata records (block, pointer operand, pointee type, read-vs-write).
collect_static_mut_access_info
Collect all basic blocks that reference mutable statics in def_id.
collect_unsafe_callsites
Collect all unsafe MIR checkpoints in def_id with full per-checkpoint metadata.
get_rawptr_deref
Analyzes the MIR of the given function to collect all local variables that are involved in dereferencing raw pointers (*const T or *mut T).
get_unsafe_callees
Scans MIR for calls to unsafe functions and returns the set of callee DefIds.
has_atomic_call
Detect whether a function performs an atomic operation, either through a compiler intrinsic (atomic_store/atomic_xadd/…) or through an Atomic* method (fetch_add/store/…).
has_raw_ptr_write
Detect whether a function writes through a raw pointer (*ptr = ...).
is_box_deref_cast 🔒
Whether rvalue is the compiler’s lowering of the safe *box deref.
place_has_raw_deref 🔒
Helper checking if a [Place] involves raw pointer dereference.
ptr_operand_for_deref_place 🔒
Extract the pointer operand from a dereference place.