Function rustc_mir_transform::coroutine::replace_local

source ·
fn replace_local<'tcx>(
    local: Local,
    ty: Ty<'tcx>,
    body: &mut Body<'tcx>,
    tcx: TyCtxt<'tcx>
) -> Local
Expand description

Allocates a new local and replaces all references of local with it. Returns the new local.

local will be changed to a new local decl with type ty.

Note that the new local will be uninitialized. It is the caller’s responsibility to assign some valid value to it before its first use.