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§

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.
deref_place_pointee_ty 🔒
Return the pointee type of the raw pointer being dereferenced.
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.
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.
resolve_callee_impl 🔒
Resolve a (possibly trait-method) callee to the concrete impl method that will actually be dispatched, given the caller context and the callee’s generic arguments.