Skip to content

Commit f804872

Browse files
committed
Fix the function return type used in get_res_dtor()
Instead of the actual return type, we're currently passing the function type to get_extern_fn(). The only reason this doesn't explode is because get_extern_fn() actually doesn't care about the actual return type, just about it being converging or not.
1 parent 1eeaf20 commit f804872

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/librustc_trans/trans/glue.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ fn trans_struct_drop_flag<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
324324

325325
pub fn get_res_dtor<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
326326
did: ast::DefId,
327-
t: Ty<'tcx>,
328327
parent_id: ast::DefId,
329328
substs: &Substs<'tcx>)
330329
-> ValueRef {
@@ -347,11 +346,8 @@ pub fn get_res_dtor<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
347346
let name = csearch::get_symbol(&ccx.sess().cstore, did);
348347
let class_ty = tcx.lookup_item_type(parent_id).ty.subst(tcx, substs);
349348
let llty = type_of_dtor(ccx, class_ty);
350-
let dtor_ty = ccx.tcx().mk_ctor_fn(did,
351-
&[get_drop_glue_type(ccx, t)],
352-
ccx.tcx().mk_nil());
353349
foreign::get_extern_fn(ccx, &mut *ccx.externs().borrow_mut(), &name[..], llvm::CCallConv,
354-
llty, dtor_ty)
350+
llty, ccx.tcx().mk_nil())
355351
}
356352
}
357353

@@ -366,7 +362,7 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
366362
debug!("trans_struct_drop t: {}", t);
367363

368364
// Find and call the actual destructor
369-
let dtor_addr = get_res_dtor(bcx.ccx(), dtor_did, t, class_did, substs);
365+
let dtor_addr = get_res_dtor(bcx.ccx(), dtor_did, class_did, substs);
370366

371367
// Class dtors have no explicit args, so the params should
372368
// just consist of the environment (self).

0 commit comments

Comments
 (0)