pub struct StoragePlan {
pub slot_classes: HashMap<SlotId, BindingStorageClass>,
pub slot_semantics: HashMap<SlotId, BindingSemantics>,
pub inline_array_sizes: HashMap<SlotId, usize>,
pub non_escaping_closure_slots: HashSet<SlotId>,
}Expand description
The computed storage plan for a single function.
Fields§
§slot_classes: HashMap<SlotId, BindingStorageClass>Maps each local slot to its decided storage class.
slot_semantics: HashMap<SlotId, BindingSemantics>Maps each local slot to its enriched binding semantics.
inline_array_sizes: HashMap<SlotId, usize>Optimization hint (Phase D.2 infrastructure): slots that hold a small, compile-time-sized aggregate (array/tuple literal) that is provably non-escaping, non-captured, and non-aliased. The value is the element count.
Consumers may choose to:
- emit inline-on-stack storage (SROA — eliminate the allocation),
- pick a SmallVec-backed
HeapValue::Arraypath, or - ignore the hint entirely (semantics-preserving).
Today no consumer acts on the hint; it is recorded so that future codegen passes (inline arrays, scalar replacement of aggregates) can activate without re-running escape analysis.
non_escaping_closure_slots: HashSet<SlotId>Closure Spec Phase B: slots that hold closure values (defined by a
ClosureCapture statement) and that provably do not escape their
enclosing function via any of the §2.1 escape vectors
(return, container store, field/index/deref write, capture by an
escaping closure, task boundary, call-site argument, or
UniqueHeap/SharedCow promotion).
Consumed by Phase C’s per-closure specialization decision: when a
closure slot is in this set, the specialization may stack-allocate the
closure and inline its body into the receiving specialization instead
of heap-allocating a TypedClosure. Slots NOT in this set are
considered escaping and must use the heap variant.
Today no consumer acts on the set (Phase C is not landed). It is recorded so the specialization pass can activate without re-running escape analysis.
Trait Implementations§
Source§impl Clone for StoragePlan
impl Clone for StoragePlan
Auto Trait Implementations§
impl Freeze for StoragePlan
impl RefUnwindSafe for StoragePlan
impl Send for StoragePlan
impl Sync for StoragePlan
impl Unpin for StoragePlan
impl UnsafeUnpin for StoragePlan
impl UnwindSafe for StoragePlan
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more