fn drop_ladder<'a>(&mut self,
                       fields: Vec<(Lvalue<'tcx>, Option<D::Path>)>)
                       -> (BasicBlock, Option<BasicBlock>)
    {
        debug!("drop_ladder({:?}, {:?})", self, fields);

        let mut fields = fields;
        fields.retain(|&(ref lvalue, _)| {
            self.lvalue_ty(lvalue).needs_drop(self.tcx(), self.elaborator.param_env())
        });

        debug!("drop_ladder - fields needing drop: {:?}", fields);

        let unwind_ladder = if self.is_cleanup {
            None
        } else {
            let unwind = self.unwind.unwrap(); // FIXME(#6393)
            Some(self.drop_halfladder(None, unwind, &fields, true))
        };

        let succ = self.succ; // FIXME(#6393)
        let is_cleanup = self.is_cleanup;
        let normal_ladder =
            self.drop_halfladder(unwind_ladder.as_ref().map(|x| &**x),
                                 succ, &fields, is_cleanup);

        (normal_ladder.last().cloned().unwrap_or(succ),
         unwind_ladder.and_then(|l| l.last().cloned()).or(self.unwind))
    }
/// Create a full drop ladder, consisting of 2 connected half-drop-ladders
///
/// For example, with 3 fields, the drop ladder is
///
/// .d0:
///     ELAB(drop location.0 [target=.d1, unwind=.c1])
/// .d1:
///     ELAB(drop location.1 [target=.d2, unwind=.c2])
/// .d2:
///     ELAB(drop location.2 [target=`self.succ`, unwind=`self.unwind`])
/// .c1:
///     ELAB(drop location.1 [target=.c2])
/// .c2:
///     ELAB(drop location.2 [target=`self.unwind`])
Create a full drop ladder, consisting of 2 connected half-drop-ladders
For example, with 3 fields, the drop ladder is


Create a full drop ladder consisting of 2 connected half - drop - ladders For example with 3 fields the drop ladder is
fn drop_ladder<'a>(&mut self,
                       fields: Vec<(Lvalue<'tcx>, Option<D::Path>)>)
                       -> (BasicBlock, Option<BasicBlock>)
    {
        debug!("drop_ladder({:?}, {:?})", self, fields);
        let mut fields = fields;
        fields.retain(|&(ref lvalue, _)| {
            self.lvalue_ty(lvalue).needs_drop(self.tcx(), self.elaborator.param_env())
        });
        debug!("drop_ladder - fields needing drop: {:?}", fields);
        let unwind_ladder = if self.is_cleanup {
            None
        } else {
            let unwind = self.unwind.unwrap(); // FIXME(#6393)
            Some(self.drop_halfladder(None, unwind, &fields, true))
        };
        let succ = self.succ; // FIXME(#6393)
        let is_cleanup = self.is_cleanup;
        let normal_ladder =
            self.drop_halfladder(unwind_ladder.as_ref().map(|x| &**x),
                                 succ, &fields, is_cleanup);
        (normal_ladder.last().cloned().unwrap_or(succ),
         unwind_ladder.and_then(|l| l.last().cloned()).or(self.unwind))
    }
fn drop_ladder < ' a > ( & mut self , fields : Vec < ( Lvalue < ' tcx > , Option < D :: Path > ) > ) -> ( BasicBlock , Option < BasicBlock > ) { debug ! ( " " self fields ) ; let mut fields = fields ; fields . retain ( | & ( ref lvalue , _ ) | { self . lvalue_ty ( lvalue ) . needs_drop ( self . tcx ( ) , self . elaborator . param_env ( ) ) } ) ; debug ! ( " " fields ) ; let unwind_ladder = if self . is_cleanup { None } else { let unwind = self . unwind . unwrap ( ) ; // FIXME(#6393) Some ( self . drop_halfladder ( None , unwind , & fields , true ) ) } ; let succ = self . succ ; // FIXME(#6393) let is_cleanup = self . is_cleanup ; let normal_ladder = self . drop_halfladder ( unwind_ladder . as_ref ( ) . map ( | x | & * * x ) , succ , & fields , is_cleanup ) ; ( normal_ladder . last ( ) . cloned ( ) . unwrap_or ( succ ) , unwind_ladder . and_then ( | l | l . last ( ) . cloned ( ) ) . or ( self . unwind ) ) }
Create a full drop ladder, consisting of 2 connected half-drop-ladders
For example, with 3 fields, the drop ladder is
Create a full drop ladder consisting of 2 connected half - drop - ladders For example with 3 fields the drop ladder is
&mut self
fields
Vec<(Lvalue<'tcx>, Option<D::Path>)>
&mut self
fields
Vec<(Lvalue<'tcx>, Option<D::Path>)>