fn visit_terminator_kind(&mut self,
                             block: mir::BasicBlock,
                             kind: &mir::TerminatorKind<'tcx>) {
        let tcx = self.scx.tcx();
        match *kind {
            mir::TerminatorKind::Call {
                func: mir::Operand::Constant(ref constant),
                ref args,
                ..
            } => {
                match constant.ty.sty {
                    ty::TyFnDef(def_id, _, bare_fn_ty)
                        if is_drop_in_place_intrinsic(tcx, def_id, bare_fn_ty) => {
                        let operand_ty = self.mir.operand_ty(tcx, &args[0]);
                        if let ty::TyRawPtr(mt) = operand_ty.sty {
                            let operand_ty = monomorphize::apply_param_substs(tcx,
                                                                              self.param_substs,
                                                                              &mt.ty);
                            let ty = glue::get_drop_glue_type(tcx, operand_ty);
                            self.output.push(TransItem::DropGlue(DropGlueKind::Ty(ty)));
                        } else {
                            bug!("Has the drop_in_place() intrinsic's signature changed?")
                        }
                    }
                    _ => { /* Nothing to do. */ }
                }
            }
            _ => { /* Nothing to do. */ }
        }

        self.super_terminator_kind(block, kind);

        fn is_drop_in_place_intrinsic<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                                def_id: DefId,
                                                bare_fn_ty: &ty::BareFnTy<'tcx>)
                                                -> bool {
            (bare_fn_ty.abi == Abi::RustIntrinsic ||
             bare_fn_ty.abi == Abi::PlatformIntrinsic) &&
            tcx.item_name(def_id).as_str() == "drop_in_place"
        }
    }
// This takes care of the "drop_in_place" intrinsic for which we otherwise
// we would not register drop-glues.
This takes care of the "drop_in_place" intrinsic for which we otherwise
we would not register drop-glues.
This takes care of the " drop_in_place " intrinsic for which we otherwise we would not register drop - glues .
fn visit_terminator_kind(&mut self,
                             block: mir::BasicBlock,
                             kind: &mir::TerminatorKind<'tcx>) {
        let tcx = self.scx.tcx();
        match *kind {
            mir::TerminatorKind::Call {
                func: mir::Operand::Constant(ref constant),
                ref args,
                ..
            } => {
                match constant.ty.sty {
                    ty::TyFnDef(def_id, _, bare_fn_ty)
                        if is_drop_in_place_intrinsic(tcx, def_id, bare_fn_ty) => {
                        let operand_ty = self.mir.operand_ty(tcx, &args[0]);
                        if let ty::TyRawPtr(mt) = operand_ty.sty {
                            let operand_ty = monomorphize::apply_param_substs(tcx,
                                                                              self.param_substs,
                                                                              &mt.ty);
                            let ty = glue::get_drop_glue_type(tcx, operand_ty);
                            self.output.push(TransItem::DropGlue(DropGlueKind::Ty(ty)));
                        } else {
                            bug!("Has the drop_in_place() intrinsic's signature changed?")
                        }
                    }
                    _ => { /* Nothing to do. */ }
                }
            }
            _ => { /* Nothing to do. */ }
        }
        self.super_terminator_kind(block, kind);
        fn is_drop_in_place_intrinsic<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                                def_id: DefId,
                                                bare_fn_ty: &ty::BareFnTy<'tcx>)
                                                -> bool {
            (bare_fn_ty.abi == Abi::RustIntrinsic ||
             bare_fn_ty.abi == Abi::PlatformIntrinsic) &&
            tcx.item_name(def_id).as_str() == "drop_in_place"
        }
    }
fn visit_terminator_kind ( & mut self , block : mir :: BasicBlock , kind : & mir :: TerminatorKind < ' tcx > ) { let tcx = self . scx . tcx ( ) ; match * kind { mir :: TerminatorKind :: Call { func : mir :: Operand :: Constant ( ref constant ) , ref args , .. } => { match constant . ty . sty { ty :: TyFnDef ( def_id , _ , bare_fn_ty ) if is_drop_in_place_intrinsic ( tcx , def_id , bare_fn_ty ) => { let operand_ty = self . mir . operand_ty ( tcx , & args [ 0 ] ) ; if let ty :: TyRawPtr ( mt ) = operand_ty . sty { let operand_ty = monomorphize :: apply_param_substs ( tcx , self . param_substs , & mt . ty ) ; let ty = glue :: get_drop_glue_type ( tcx , operand_ty ) ; self . output . push ( TransItem :: DropGlue ( DropGlueKind :: Ty ( ty ) ) ) ; } else { bug ! ( " " ) } } _ => { /* Nothing to do. */ } } } _ => { /* Nothing to do. */ } } self . super_terminator_kind ( block , kind ) ; fn is_drop_in_place_intrinsic < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId , bare_fn_ty : & ty :: BareFnTy < ' tcx > ) -> bool { ( bare_fn_ty . abi == Abi :: RustIntrinsic || bare_fn_ty . abi == Abi :: PlatformIntrinsic ) && tcx . item_name ( def_id ) . as_str ( ) == " " } }
This takes care of the "drop_in_place" intrinsic for which we otherwise
we would not register drop-glues.
This takes care of the " drop_in_place " intrinsic for which we otherwise we would not register drop - glues .
&mut self
block
mir::BasicBlock
kind
&mir::TerminatorKind<'tcx>
&mut self
block
mir::BasicBlock
kind
&mir::TerminatorKind<'tcx>