/// 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=`c.succ`, unwind=`c.unwind`])
/// .c1:
///     ELAB(drop location.1 [target=.c2])
/// .c2:
///     ELAB(drop location.2 [target=`c.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,
                       c: &DropCtxt<'a, 'tcx>,
                       fields: Vec<(Lvalue<'tcx>, Option<MovePathIndex>)>)
                       -> BasicBlock
    {
        debug!("drop_ladder({:?}, {:?})", c, fields);
        let mut fields = fields;
        fields.retain(|&(ref lvalue, _)| {
            let ty = self.mir.lvalue_ty(self.tcx, lvalue).to_ty(self.tcx);
            self.tcx.type_needs_drop_given_env(ty, self.param_env())
        });
        debug!("drop_ladder - fields needing drop: {:?}", fields);
        let unwind_ladder = if c.is_cleanup {
            None
        } else {
            Some(self.drop_halfladder(c, None, c.unwind.unwrap(), &fields, true))
        };
        self.drop_halfladder(c, unwind_ladder, c.succ, &fields, c.is_cleanup)
            .last().cloned().unwrap_or(c.succ)
    }
fn drop_ladder < ' a > ( & mut self , c : & DropCtxt < ' a , ' tcx > , fields : Vec < ( Lvalue < ' tcx > , Option < MovePathIndex > ) > ) -> BasicBlock { debug ! ( " " c fields ) ; let mut fields = fields ; fields . retain ( | & ( ref lvalue , _ ) | { let ty = self . mir . lvalue_ty ( self . tcx , lvalue ) . to_ty ( self . tcx ) ; self . tcx . type_needs_drop_given_env ( ty , self . param_env ( ) ) } ) ; debug ! ( " " fields ) ; let unwind_ladder = if c . is_cleanup { None } else { Some ( self . drop_halfladder ( c , None , c . unwind . unwrap ( ) , & fields , true ) ) } ; self . drop_halfladder ( c , unwind_ladder , c . succ , & fields , c . is_cleanup ) . last ( ) . cloned ( ) . unwrap_or ( c . succ ) }
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
c
&DropCtxt<'a, 'tcx>
fields
Vec<(Lvalue<'tcx>, Option<MovePathIndex>)>