// Scheduling drops
// ================
/// Indicates that `lvalue` should be dropped on exit from
/// `extent`.
Scheduling drops
Indicates that `lvalue` should be dropped on exit from
`extent`.
Scheduling drops Indicates that ` lvalue ` should be dropped on exit from ` extent ` .
pub fn schedule_drop(&mut self,
                         span: Span,
                         extent: CodeExtent,
                         lvalue: &Lvalue<'tcx>,
                         lvalue_ty: Ty<'tcx>) {
        if !self.hir.needs_drop(lvalue_ty) {
            return
        }
        for scope in self.scopes.iter_mut().rev() {
            if scope.extent == extent {
                // No need to invalidate any caches here. The just-scheduled drop will branch into
                // the drop that comes before it in the vector.
                scope.drops.push(DropData {
                    span: span,
                    location: lvalue.clone(),
                    cached_block: None
                });
                return;
            } else {
                // We must invalidate all the cached_blocks leading up to the scope we’re
                // looking for, because all of the blocks in the chain will become incorrect.
                scope.invalidate_cache()
            }
        }
        span_bug!(span, "extent {:?} not in scope to drop {:?}", extent, lvalue);
    }
pub fn schedule_drop ( & mut self , span : Span , extent : CodeExtent , lvalue : & Lvalue < ' tcx > , lvalue_ty : Ty < ' tcx > ) { if ! self . hir . needs_drop ( lvalue_ty ) { return } for scope in self . scopes . iter_mut ( ) . rev ( ) { if scope . extent == extent { // No need to invalidate any caches here. The just-scheduled drop will branch into // the drop that comes before it in the vector. scope . drops . push ( DropData { span : span , location : lvalue . clone ( ) , cached_block : None } ) ; return ; } else { // We must invalidate all the cached_blocks leading up to the scope we’re // looking for, because all of the blocks in the chain will become incorrect. scope . invalidate_cache ( ) } } span_bug ! ( span " " extent lvalue ) ; }
Scheduling drops
Indicates that `lvalue` should be dropped on exit from
`extent`.
Scheduling drops Indicates that ` lvalue ` should be dropped on exit from ` extent ` .
&mut self
span
Span
extent
CodeExtent
lvalue
&Lvalue<'tcx>
lvalue_ty
Ty<'tcx>