fn post_store<'blk, 'tcx>(&self,
                              bcx: Block<'blk, 'tcx>,
                              val: ValueRef,
                              ty: Ty<'tcx>)
                              -> Block<'blk, 'tcx> {
        let _icx = push_ctxt("<Lvalue as KindOps>::post_store");
        if bcx.fcx.type_needs_drop(ty) {
            // cancel cleanup of affine values:
            // 1. if it has drop-hint, mark as moved; then code
            //    aware of drop-hint won't bother calling the
            //    drop-glue itself.
            if let Some(hint_datum) = self.drop_flag_info.hint_datum(bcx) {
                let moved_hint_byte = adt::DTOR_MOVED_HINT;
                let hint_llval = hint_datum.to_value().value();
                Store(bcx, C_u8(bcx.fcx.ccx, moved_hint_byte), hint_llval);
            }
            // 2. if the drop info says its necessary, drop-fill the memory.
            if self.drop_flag_info.must_zero() {
                let () = drop_done_fill_mem(bcx, val, ty);
            }
            bcx
        } else {
            // FIXME (#5016) would be nice to assert this, but we have
            // to allow for e.g. DontZeroJustUse flags, for now.
            //
            // (The dropflag hint construction should be taking
            // !type_needs_drop into account; earlier analysis phases
            // may not have all the info they need to include such
            // information properly, I think; in particular the
            // fragments analysis works on a non-monomorphized view of
            // the code.)
            //
            // assert_eq!(self.drop_flag_info, DropFlagInfo::None);
            bcx
        }
    }
/// If an lvalue is moved, we must zero out the memory in which it resides so as to cancel
/// cleanup. If an @T lvalue is copied, we must increment the reference count.
If an lvalue is moved, we must zero out the memory in which it resides so as to cancel
cleanup. If an @T lvalue is copied, we must increment the reference count.
If an lvalue is moved we must zero out the memory in which it resides so as to cancel cleanup . If an @T lvalue is copied we must increment the reference count .
fn post_store<'blk, 'tcx>(&self,
                              bcx: Block<'blk, 'tcx>,
                              val: ValueRef,
                              ty: Ty<'tcx>)
                              -> Block<'blk, 'tcx> {
        let _icx = push_ctxt("<Lvalue as KindOps>::post_store");
        if bcx.fcx.type_needs_drop(ty) {
            // cancel cleanup of affine values:
            // 1. if it has drop-hint, mark as moved; then code
            //    aware of drop-hint won't bother calling the
            //    drop-glue itself.
            if let Some(hint_datum) = self.drop_flag_info.hint_datum(bcx) {
                let moved_hint_byte = adt::DTOR_MOVED_HINT;
                let hint_llval = hint_datum.to_value().value();
                Store(bcx, C_u8(bcx.fcx.ccx, moved_hint_byte), hint_llval);
            }
            // 2. if the drop info says its necessary, drop-fill the memory.
            if self.drop_flag_info.must_zero() {
                let () = drop_done_fill_mem(bcx, val, ty);
            }
            bcx
        } else {
            // FIXME (#5016) would be nice to assert this, but we have
            // to allow for e.g. DontZeroJustUse flags, for now.
            //
            // (The dropflag hint construction should be taking
            // !type_needs_drop into account; earlier analysis phases
            // may not have all the info they need to include such
            // information properly, I think; in particular the
            // fragments analysis works on a non-monomorphized view of
            // the code.)
            //
            // assert_eq!(self.drop_flag_info, DropFlagInfo::None);
            bcx
        }
    }
fn post_store < ' blk , ' tcx > ( & self , bcx : Block < ' blk , ' tcx > , val : ValueRef , ty : Ty < ' tcx > ) -> Block < ' blk , ' tcx > { let _icx = push_ctxt ( " " ) ; if bcx . fcx . type_needs_drop ( ty ) { // cancel cleanup of affine values: // 1. if it has drop-hint, mark as moved; then code //    aware of drop-hint won't bother calling the //    drop-glue itself. if let Some ( hint_datum ) = self . drop_flag_info . hint_datum ( bcx ) { let moved_hint_byte = adt :: DTOR_MOVED_HINT ; let hint_llval = hint_datum . to_value ( ) . value ( ) ; Store ( bcx , C_u8 ( bcx . fcx . ccx , moved_hint_byte ) , hint_llval ) ; } // 2. if the drop info says its necessary, drop-fill the memory. if self . drop_flag_info . must_zero ( ) { let ( ) = drop_done_fill_mem ( bcx , val , ty ) ; } bcx } else { // FIXME (#5016) would be nice to assert this, but we have // to allow for e.g. DontZeroJustUse flags, for now. // // (The dropflag hint construction should be taking // !type_needs_drop into account; earlier analysis phases // may not have all the info they need to include such // information properly, I think; in particular the // fragments analysis works on a non-monomorphized view of // the code.) // // assert_eq!(self.drop_flag_info, DropFlagInfo::None); bcx } }
If an lvalue is moved, we must zero out the memory in which it resides so as to cancel
cleanup.
If an lvalue is moved we must zero out the memory in which it resides so as to cancel cleanup .
&self
bcx
Block<'blk, 'tcx>
val
ValueRef
ty
Ty<'tcx>
&self
bcx
Block<'blk, 'tcx>
val
ValueRef
ty
Ty<'tcx>