Skip to main content

Module reference

Module reference 

Source
Expand description

Reference-value carrier — the kinded redesign of the deleted nanboxed::RefTarget / RefProjection ValueWord-shaped enum.

ADR-006 §2.7.13 / Q14 (Wave 8 W8-T26, 2026-05-10). Each variant carries the NativeKind of the projected slot, threaded from the producing- opcode emit per §2.7.7 / §2.7.8 / §2.7.10 / §2.7.11 invariant. Loading and storing through a ref read the carried kind directly — no tag-bit decoding, no kind fabrication at projection time, no is_heap() probe.

Slot bits for a Reference-labeled slot are Arc::into_raw(Arc<RefTarget>) as u64 (mirror of §2.7.9 FilterExpr — NOT a Box::into_raw(Box<HeapValue>) wrap). clone_with_kind / drop_with_kind retain/release Arc<RefTarget> directly via the HeapKind::Reference dispatch arm. slot.as_heap_value() is undefined behavior on Reference-labeled bits, same as FilterExpr.

HeapValue::Reference(Arc<RefTarget>) is provided ONLY to preserve the ADR-005 §1 / ADR-006 §2.3 HeapKindHeapValue symmetry property — no caller materializes a Reference through HeapValue pattern matching.

Enums§

RefTarget
Kinded reference target.