pub struct FunctionBorrowSummary {
pub param_borrows: Vec<Option<BorrowKind>>,
pub conflict_pairs: Vec<(usize, usize)>,
pub return_summary: Option<ReturnReferenceSummary>,
pub return_ownership_mode: ReturnOwnershipMode,
pub closure_param_escapes: Vec<bool>,
}Expand description
Summary of a function’s parameter borrow requirements. Used for interprocedural alias checking at call sites.
Fields§
§param_borrows: Vec<Option<BorrowKind>>Per-parameter borrow mode: None = owned, Some(Shared/Exclusive) = by reference.
conflict_pairs: Vec<(usize, usize)>Pairs of parameter indices that must not alias (one is mutated, the other is read).
return_summary: Option<ReturnReferenceSummary>If the function returns a reference derived from a parameter, records which parameter and borrow kind. Used for interprocedural composition.
return_ownership_mode: ReturnOwnershipModeOwnership classification of the function’s return value (Phase 5.A). Used by callers to skip unnecessary Arc→Box promotion when the callee already returns a uniquely-owned value.
closure_param_escapes: Vec<bool>Per-parameter closure-escape bit (Closure Spec Phase B).
closure_param_escapes[i] == true means the parameter at index i may
flow into one of the §2.1 escape vectors inside the function body
(returned, stored in a container, stored in a struct field, captured by
another closure, sent across a task boundary, passed through
snapshot(), written through a deref, or promoted to UniqueHeap /
SharedCow storage). false means the parameter is only used in
benign ways — read locally, called, or passed to a callee whose own
summary says the corresponding parameter is non-escaping.
Length equals the number of function parameters. Used by the
storage-planning pass to decide whether a closure passed as a call-site
argument needs to be heap-allocated. The conservative default is
true for every parameter — Phase B only relaxes for clear,
intraprocedural cases; Phase C will tighten further once
monomorphization finalizes callee identity.
Trait Implementations§
Source§impl Clone for FunctionBorrowSummary
impl Clone for FunctionBorrowSummary
Auto Trait Implementations§
impl Freeze for FunctionBorrowSummary
impl RefUnwindSafe for FunctionBorrowSummary
impl Send for FunctionBorrowSummary
impl Sync for FunctionBorrowSummary
impl Unpin for FunctionBorrowSummary
impl UnsafeUnpin for FunctionBorrowSummary
impl UnwindSafe for FunctionBorrowSummary
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