Expand description
Alias checks combining VM provenance with MIR hazard analysis.
Trace a pointerβs allocation back to its source, then check whether a reference view, ownership transfer, read, or copy violates Alias.
Re-exportsΒ§
use crate::analysis::alias::hazard as alias_hazard;πuse crate::analysis::alias::hazard::AliasProducer;πuse crate::analysis::alias::hazard::HazardKind;πuse crate::analysis::alias::FieldOrigin;πuse crate::analysis::dataflow::pointer_flow;πuse crate::compat::GenericArgsRef;πuse crate::def_ids::type_ids;πuse crate::util::def_use::PlaceKey;πuse crate::util::mir_utils;πuse crate::verify::checkpoint::Checkpoint;πuse crate::vm::state::VmExecutor;πuse crate::vm::state::VmValue;πuse rustc_hir::def_id::DefId;πuse rustc_middle::mir::Local;πuse rustc_middle::mir::Operand;πuse rustc_middle::mir::ProjectionElem;πuse rustc_middle::mir::Rvalue;πuse rustc_middle::mir::StatementKind;π
StructsΒ§
- VmOrigin π
- Information about a valueβs ultimate origin.
EnumsΒ§
- VmAlias
Result π - Result of an Alias check using VM state.
- VmOrigin
Kind π
FunctionsΒ§
- check_
alias_ πvm - Run the full alias hazard check for the VM backend.
- check_
copy_ πmemory_ alias - 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. - escaped_
parameter_ πorigin - find_
struct_ πfield_ origin_ for_ param - Find a self field origin through the checkpoint argument or a copied local.
- 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. - 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. - origin_
alias_ πhazard_ accepted - 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 - Trace a local through copies and 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. - self_
field_ πorigin - 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.