Skip to main content

Module alias_tree

Module alias_tree 

Source
Expand description

Per-function alias derivation forest, used only for field-path resolution.

Every pointer-bearing local is a node; an edge parent ← child records that the child was derived from the parent (reborrow, raw-pointer cast, field read), each edge carrying the field path (self.node.ptr → [node, ptr]). AliasTree::resolve_local_to_root walks the forest to the root local, concatenating field paths, which the escape/encapsulation analysis uses to find which struct field a view came from.

The view-vs-view (shared-XOR-mutable) aliasing check no longer lives here — it is flow-sensitive and walks the VM’s current locals + allocation parent chain (flow_xor_violation in vm/alias.rs), so this static forest is not consulted for live-value grouping.

Structs§

AliasNode 🔒
A single node in the alias forest.
AliasTree 🔒
The per-function alias derivation forest.

Functions§

classify 🔒
Whether ty is pointer-bearing (Ref/RawPtr/Adt), returning whether it is an owned container (Box/Vec/… — a forest root) when it is.
field_projection 🔒
The Field projection indices of place, in order (Deref/index/etc. are skipped), matching PlaceKey::fields.

Type Aliases§

TagId 🔒
A node identifier (index into AliasTree::nodes).