Expand description
MIR-level alias hazard scanning for the symbolic VM backend.
This module holds the pure MIR hazard analysis (origin-based parameter
safety, escape analysis, local hazard scanning, and ownership-transfer
violation scanning) independent of VM state and Z3 terms. It was extracted
from the old forward verifierβs smt_check/alias.rs.
vm/alias.rs provides the VM-specific provenanceβorigin resolution and
orchestrates the overall alias check, calling into this module for the
underlying MIR scanning.
StructsΒ§
- Local
Callsite π
EnumsΒ§
- Alias
Producer π - Hazard
Check π - Hazard
Kind π - RawAccess
Kind π
FunctionsΒ§
- alias_
producer π - alias_
proved_ πfor_ param_ local - alias_
proved_ πfor_ param_ local_ from_ origin - any_
struct_ πfield_ origin - callsite_
arg_ πorigins - check_
fn_ πagainst_ field - Check whether
item(a struct method or a same-module free function) writes or exposes the raw fieldoriginthrough the borrow carried byself_local. A shared current borrow (&self) is not invalidated by a mutable item borrow (&mut self), and a mutable/mutable pair is likewise fine; any other combination is a violation. Returns the violation description, orNone. - destination_
flows_ πto_ return - escaped_
self_ πfield_ violation - expand_
hazard_ πalias_ locals - expand_
origin_ πaliases - find_
as_ πptr_ receivers - free_
fns_ πfor_ struct - Collect the free functions in the structβs own module that take a
&Struct/&mut Structparameter. Rust privacy is module-scoped, so only those can reach a private raw field. Each entry pairs the function with the parameter locals that carry the struct reference. - hazard_
used_ πafter_ block - hazard_
used_ πafter_ statement - impls_
for_ πstruct - is_
origin_ πa_ reference - is_
ptr_ πadd_ offset_ eq - is_
ptr_ πfrom_ ptr_ add - kill_
strongly_ πupdated_ origins - live_
locals_ πat - Compute the set of locals that are live (between
StorageLiveandStorageDead) at the deref point(call_block, statement_index), scanning the function in execution order up to that point. Used by the callsite shared-XOR-mutable check to ignore temporaries that have already gone dead (e.g. a method callβs&selfreceiver). - local_
callsites π - local_
hazard_ πviolation - local_
hazard_ πviolation_ with - local_
traces_ πto_ self_ field - Backward-traces
localthrough MIR assignments to check whether its value is derived from(*self_local).field_index. - method_
exposes_ πself_ field - Whether
methodreturns a raw-pointer-bearing value derived from the fieldfield_indexof the struct borrowed viaself_local, i.e. it leaks the raw field to the caller. - method_
writes_ πself_ field - Whether
methodwrites through the raw fieldfield_indexof the struct borrowed viaself_local(_1for a method, any parameter for a free fn). - ownership_
transfer_ πviolation - param_
index_ πof_ origin - Return the 0-based argument index for
originwhen it is a direct, whole raw-pointer parameter (no field projections, no local-copy tracing). - place_
is_ πraw_ access_ to_ any_ origin - place_
is_ πraw_ access_ to_ live_ origin - place_
is_ πraw_ access_ to_ origin - place_
key_ πis_ prefix_ of - place_
raw_ πaccesses_ self_ field - Whether
placeis a raw-pointer deref whose operand traces back to the fieldfield_indexof the struct borrowed viaself_local. - places_
holding_ πtransferred_ pointer - pre_
existing_ πview_ on_ origin - private_
fn_ πcallsite_ delegation - public_
raw_ πfield - raw_
access_ πconflicts - resolve_
mir_ πplace_ tree - Resolve a MIR place through the alias tree: a field-projected place resolves to itself; a whole-local place resolves to its ultimate origin.
- resolve_
param_ πorigin - Resolve
originto a parameter MIR local, tracing through local-copy origins when the base is not itself a parameter. - resolve_
place_ πkey_ tree - Resolve a placeβs local through the alias tree (ignoring the placeβs own field projections), falling back to the MIR place itself when unmapped.
- resolve_
via_ πtree - Resolve
(local, fields)through the alias tree: a place that already names a field path resolves to itself; a whole-local place resolves to its ultimate(root, fields)origin. - reverse_
postorder_ πblocks - rvalue_
copies_ πlive_ origin_ value - rvalue_
mentions_ πany_ local - rvalue_
mentions_ πlocal - rvalue_
mentions_ πorigin - rvalue_
reads_ πany_ origin - rvalue_
reads_ πlike_ view - self_
borrow_ πmutability - The mutability (
Not/Mut) of the borrow carried byself_localβs type (a&T/&mut T), orNoneif it is not a reference.self_localis_1for a method receiver, and any parameter for a free function. - self_
field_ πkey - The
PlaceKeyfor(*self_local).field_index. - self_
field_ πorigin - splice_
holder_ πfields - statement_
uses_ πany_ local - struct_
ref_ πparam_ locals - Return the parameter locals of
def_idwhose type is a&Struct/&mut Structreference tostruct_def_id. - terminator_
invalidates_ πvec_ owner - terminator_
is_ πbenign_ origin_ use - terminator_
returns_ πownership - terminator_
uses_ πany_ local - terminator_
uses_ πlive_ origin - terminator_
uses_ πorigin - terminator_
writes_ πorigin