pub fn lvalue_scratch_datum<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
                                           ty: Ty<'tcx>,
                                           name: &str,
                                           zero: InitAlloca,
                                           scope: cleanup::ScopeId,
                                           populate: F)
                                           -> DatumBlock<'blk, 'tcx, Lvalue> where
    F: FnOnce(Block<'blk, 'tcx>, ValueRef) -> Block<'blk, 'tcx>,
{
    // Very subtle: potentially initialize the scratch memory at point where it is alloca'ed.
    // (See discussion at Issue 30530.)
    let scratch = alloc_ty_init(bcx, ty, zero, name);
    debug!("lvalue_scratch_datum scope={:?} scratch={:?} ty={:?}",
           scope, Value(scratch), ty);

    // Subtle. Populate the scratch memory *before* scheduling cleanup.
    let bcx = populate(bcx, scratch);
    bcx.fcx.schedule_drop_mem(scope, scratch, ty, None);

    DatumBlock::new(bcx, Datum::new(scratch, ty, Lvalue::new("datum::lvalue_scratch_datum")))
}
/// Allocates temporary space on the stack using alloca() and returns a by-ref Datum pointing to
/// it. The memory will be dropped upon exit from `scope`. The callback `populate` should
/// initialize the memory.
///
/// The flag `zero` indicates how the temporary space itself should be
/// initialized at the outset of the function; the only time that
/// `InitAlloca::Uninit` is a valid value for `zero` is when the
/// caller can prove that either (1.) the code injected by `populate`
/// onto `bcx` always dominates the end of `scope`, or (2.) the data
/// being allocated has no associated destructor.
Allocates temporary space on the stack using alloca() and returns a by-ref Datum pointing to
it. The memory will be dropped upon exit from `scope`. The callback `populate` should
initialize the memory.


Allocates temporary space on the stack using alloca () and returns a by - ref Datum pointing to it . The memory will be dropped upon exit from ` scope ` . The callback ` populate ` should initialize the memory .
pub fn lvalue_scratch_datum<'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
                                           ty: Ty<'tcx>,
                                           name: &str,
                                           zero: InitAlloca,
                                           scope: cleanup::ScopeId,
                                           populate: F)
                                           -> DatumBlock<'blk, 'tcx, Lvalue> where
    F: FnOnce(Block<'blk, 'tcx>, ValueRef) -> Block<'blk, 'tcx>,
{
    // Very subtle: potentially initialize the scratch memory at point where it is alloca'ed.
    // (See discussion at Issue 30530.)
    let scratch = alloc_ty_init(bcx, ty, zero, name);
    debug!("lvalue_scratch_datum scope={:?} scratch={:?} ty={:?}",
           scope, Value(scratch), ty);
    // Subtle. Populate the scratch memory *before* scheduling cleanup.
    let bcx = populate(bcx, scratch);
    bcx.fcx.schedule_drop_mem(scope, scratch, ty, None);
    DatumBlock::new(bcx, Datum::new(scratch, ty, Lvalue::new("datum::lvalue_scratch_datum")))
}
pub fn lvalue_scratch_datum < ' blk , ' tcx , F > ( bcx : Block < ' blk , ' tcx > , ty : Ty < ' tcx > , name : & str , zero : InitAlloca , scope : cleanup :: ScopeId , populate : F ) -> DatumBlock < ' blk , ' tcx , Lvalue > where F : FnOnce ( Block < ' blk , ' tcx > , ValueRef ) -> Block < ' blk , ' tcx > , { // Very subtle: potentially initialize the scratch memory at point where it is alloca'ed. // (See discussion at Issue 30530.) let scratch = alloc_ty_init ( bcx , ty , zero , name ) ; debug ! ( " " scope Value ( scratch ) ty ) ; // Subtle. Populate the scratch memory *before* scheduling cleanup. let bcx = populate ( bcx , scratch ) ; bcx . fcx . schedule_drop_mem ( scope , scratch , ty , None ) ; DatumBlock :: new ( bcx , Datum :: new ( scratch , ty , Lvalue :: new ( " " ) ) ) }
Allocates temporary space on the stack using alloca() and returns a by-ref Datum pointing to
it.
Allocates temporary space on the stack using alloca () and returns a by - ref Datum pointing to it .
bcx
Block<'blk, 'tcx>
ty
Ty<'tcx>
name
&str
zero
InitAlloca
scope
cleanup::ScopeId
populate
F
bcx
Block<'blk, 'tcx>
ty
Ty<'tcx>
name
&str
zero
InitAlloca
scope
cleanup::ScopeId
populate
F