Skip to main content

find_array_assign

Function find_array_assign 

Source
fn find_array_assign(
    body: &ExprBody,
    start: BlockId,
    src_local: LocalId,
) -> Option<PayloadAssign>
Expand description

Given src, find the unique statement of the form src = [elems...] where the rvalue is an array aggregate.

Also returns whether a straight-line path from start hits a branch before reaching the assignment. We ignore unwind edges; this matches the later rewrite’s ability to erase the allocation when the normal path to initialization is linear.