Skip to content

rustc: remove ty::LegacyDtor #6178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions src/librustc/middle/trans/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,8 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
// Call the dtor if there is one
match ty::ty_dtor(bcx.tcx(), did) {
ty::NoDtor => bcx,
ty::LegacyDtor(ref dt_id) => {
trans_struct_drop(bcx, t, v, *dt_id, did, substs, false)
}
ty::TraitDtor(ref dt_id) => {
trans_struct_drop(bcx, t, v, *dt_id, did, substs, true)
trans_struct_drop(bcx, t, v, *dt_id, did, substs)
}
}
}
Expand All @@ -461,8 +458,7 @@ pub fn trans_struct_drop(bcx: block,
v0: ValueRef,
dtor_did: ast::def_id,
class_did: ast::def_id,
substs: &ty::substs,
take_ref: bool)
substs: &ty::substs)
-> block {
let repr = adt::represent_type(bcx.ccx(), t);
let drop_flag = adt::trans_drop_flag_ptr(bcx, repr, v0);
Expand All @@ -484,15 +480,10 @@ pub fn trans_struct_drop(bcx: block,
// (self)
assert!((params.len() == 2));

// If we need to take a reference to the class (because it's using
// the Drop trait), do so now.
let llval;
if take_ref {
llval = alloca(bcx, val_ty(v0));
Store(bcx, v0, llval);
} else {
llval = v0;
}
// Take a reference to the class (because it's using the Drop trait),
// do so now.
let llval = alloca(bcx, val_ty(v0));
Store(bcx, v0, llval);

let self_arg = PointerCast(bcx, llval, params[1]);
let args = ~[C_null(T_ptr(T_i8())), self_arg];
Expand Down Expand Up @@ -534,10 +525,7 @@ pub fn make_drop_glue(bcx: block, v0: ValueRef, t: ty::t) {
let tcx = bcx.tcx();
match ty::ty_dtor(tcx, did) {
ty::TraitDtor(dtor) => {
trans_struct_drop(bcx, t, v0, dtor, did, substs, true)
}
ty::LegacyDtor(dtor) => {
trans_struct_drop(bcx, t, v0, dtor, did, substs, false)
trans_struct_drop(bcx, t, v0, dtor, did, substs)
}
ty::NoDtor => {
// No dtor? Just the default case
Expand Down
1 change: 0 additions & 1 deletion src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3728,7 +3728,6 @@ pub fn item_path_str(cx: ctxt, id: ast::def_id) -> ~str {

pub enum DtorKind {
NoDtor,
LegacyDtor(def_id),
TraitDtor(def_id)
}

Expand Down