fn build_scope_drops<'tcx>(
cfg: &mut CFG<'tcx>,
unwind_drops: &mut DropTree,
scope: &Scope,
block: BasicBlock,
unwind_to: DropIdx,
storage_dead_on_unwind: bool,
arg_count: usize,
) -> BlockAnd<()>
Expand description
Builds drops for pop_scope
and leave_top_scope
.
§Parameters
unwind_drops
, the drop tree data structure storing what needs to be cleaned up if unwind occursscope
, describes the drops that will occur on exiting the scope in regular executionblock
, the block to branch to once drops are complete (assuming no unwind occurs)unwind_to
, describes the drops that would occur at this point in the code if a panic occurred (a subset of the drops inscope
, since we sometimes elide StorageDead and other instructions on unwinding)storage_dead_on_unwind
, if true, then we should emitStorageDead
even when unwindingarg_count
, number of MIR local variables corresponding to fn arguments (used to assert that we don’t drop those)