pub unsafe fn drop_owned_mutable_capture(
layout: &ClosureLayout,
base: *mut u8,
i: usize,
)Expand description
Drop the OwnedMutable capture at index i of a closure block.
Reads the typed *mut T from the slot at
layout.heap_capture_offset(i), dispatches on
layout.capture_inner_kind(i), and reclaims the box via
Box::from_raw. For FieldKind::Ptr the interior bits carry one
heap-refcount share that is released via [release_raw_value_bits]
BEFORE the box is freed — mirroring the immutable-Ptr semantics that
heap_capture_mask enforces for non-mutable captures.
§Safety
basemust point to a liveTypedClosureHeaderblock whose layout matcheslayoutand has at leasti + 1captures.layout.capture_kinds[i]must beCaptureKind::OwnedMutable.- The slot at
layout.heap_capture_offset(i)must contain a non-null pointer obtained from the matchingalloc_owned_mutable_<kind>for the interiorFieldKind, or it may be null (which is a no-op). - The block must currently be in the refcount-zero teardown phase — no other thread may concurrently access this slot.