Expand description
VM-specific alias origin tracing.
Bridges VmState provenance tracking with the shared alias_hazard
MIR scanning infrastructure. The VM already tracks which AllocId
each localโs value points to; this module traces that provenance
back to the originating parameter/local.
Structsยง
- VmOrigin ๐
- Information about a valueโs ultimate origin.
Enumsยง
- VmAlias
Result ๐ - Result of the VM-based alias check.
- VmOrigin
Kind ๐
Functionsยง
- check_
alias_ ๐vm - Run the full alias hazard check for the VM backend.
- check_
escaped_ ๐field - Shared escape + field-encapsulation check: a view that escapes and traces to
a struct field is safe only if the field is private and not written/exposed
by safe code. A unique (
&mut) view escaping through a private raw field is still unsound โ the caller can re-enter and obtain a second&mut. - check_
ownership_ ๐transfer_ alias - check_
read_ ๐memory_ alias - check_
view_ ๐alias - escape_
region_ ๐violation - Check whether the shared viewโs claimed return region outlives the source
reference
localโs region. Returns a violation reason when it does. - find_
struct_ ๐field_ origin_ for_ param - Attempt to extract the MIR local index from an operand for PlaceKey construction. Try to find a struct field origin by examining checkpoint arguments and the functionโs self type. Handles the case where origin tracing fails to resolve through intermediate locals.
- flow_
xor_ ๐violation - Flow-sensitive shared-XOR-mutable check for a view-producing checkpoint.
Walks the VMโs current locals (not a static derivation tree), grouping a
live reference view as conflicting when it names the same allocation, or a
sub-allocation of it (
root_allocโfrom_raw_parts/split_atkeep aparentedge), with the opposite mutability. - fn_
has_ ๐alias_ requires - Whether the caller declares an
Aliasassumption in its#[rapx::requires](directly or via a compound likePtr2Ref). Such a function relies on its caller-guaranteed precondition rather than on field encapsulation, so the field-encapsulation escape check must not fire on it. - infer_
self_ ๐field_ from_ type - When origin tracing fails to resolve the exact struct field, try to infer it from the functionโs self type. Looks for a raw pointer field in the struct โ for simple wrappers with a single raw pointer field, this works reliably.
- is_
self_ ๐field_ shared_ ref - Check whether a self fieldโs type is a shared reference (
&Tor&[T]). Used by raw-ptr-deref alias checks to prove shared views are safe when the underlying field is a shared reference. - property_
contains_ ๐alias - Whether a contract property tree contains an
Aliasatom (used to detect a caller-declaredAlias/Ptr2Refprecondition). - resolve_
escaped_ ๐field_ origin - Resolve the struct field an escaping view came from: try the derivation tree first (via the resolved and raw origins), then fall back to self-type heuristics when tree resolution fails to reach a field.
- resolve_
origin_ ๐place_ mir - copies/casts (e.g.
_tmp = self.ptrโ_1.0). - self_
adt ๐ - Extract the
&self/&mut selfreceiverโs ADT (peeling one reference layer), orNonefor non-ADT receivers. Shared by the struct-field origin heuristics. - shared_
view_ ๐escape_ region_ violation - A shared view re-borrowed from the reference parameter
localand returned must not claim a region that outlives the parameterโs own region. Returns a violation reason whenlocalโs region does not outlive the return region.