Skip to content

Commit 1c64f7a

Browse files
committed
auto merge of #6178 : erickt/rust/remove-drop, r=graydon
This patch removes ty::LegacyDtor, which is no longer used.
2 parents 89377ea + c1de90c commit 1c64f7a

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

src/librustc/middle/trans/glue.rs

+7-19
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,8 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
443443
// Call the dtor if there is one
444444
match ty::ty_dtor(bcx.tcx(), did) {
445445
ty::NoDtor => bcx,
446-
ty::LegacyDtor(ref dt_id) => {
447-
trans_struct_drop(bcx, t, v, *dt_id, did, substs, false)
448-
}
449446
ty::TraitDtor(ref dt_id) => {
450-
trans_struct_drop(bcx, t, v, *dt_id, did, substs, true)
447+
trans_struct_drop(bcx, t, v, *dt_id, did, substs)
451448
}
452449
}
453450
}
@@ -461,8 +458,7 @@ pub fn trans_struct_drop(bcx: block,
461458
v0: ValueRef,
462459
dtor_did: ast::def_id,
463460
class_did: ast::def_id,
464-
substs: &ty::substs,
465-
take_ref: bool)
461+
substs: &ty::substs)
466462
-> block {
467463
let repr = adt::represent_type(bcx.ccx(), t);
468464
let drop_flag = adt::trans_drop_flag_ptr(bcx, repr, v0);
@@ -484,15 +480,10 @@ pub fn trans_struct_drop(bcx: block,
484480
// (self)
485481
assert!((params.len() == 2));
486482

487-
// If we need to take a reference to the class (because it's using
488-
// the Drop trait), do so now.
489-
let llval;
490-
if take_ref {
491-
llval = alloca(bcx, val_ty(v0));
492-
Store(bcx, v0, llval);
493-
} else {
494-
llval = v0;
495-
}
483+
// Take a reference to the class (because it's using the Drop trait),
484+
// do so now.
485+
let llval = alloca(bcx, val_ty(v0));
486+
Store(bcx, v0, llval);
496487

497488
let self_arg = PointerCast(bcx, llval, params[1]);
498489
let args = ~[C_null(T_ptr(T_i8())), self_arg];
@@ -534,10 +525,7 @@ pub fn make_drop_glue(bcx: block, v0: ValueRef, t: ty::t) {
534525
let tcx = bcx.tcx();
535526
match ty::ty_dtor(tcx, did) {
536527
ty::TraitDtor(dtor) => {
537-
trans_struct_drop(bcx, t, v0, dtor, did, substs, true)
538-
}
539-
ty::LegacyDtor(dtor) => {
540-
trans_struct_drop(bcx, t, v0, dtor, did, substs, false)
528+
trans_struct_drop(bcx, t, v0, dtor, did, substs)
541529
}
542530
ty::NoDtor => {
543531
// No dtor? Just the default case

src/librustc/middle/ty.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3728,7 +3728,6 @@ pub fn item_path_str(cx: ctxt, id: ast::def_id) -> ~str {
37283728

37293729
pub enum DtorKind {
37303730
NoDtor,
3731-
LegacyDtor(def_id),
37323731
TraitDtor(def_id)
37333732
}
37343733

0 commit comments

Comments
 (0)