Skip to content

rm special case for ty_struct from take glue #9751

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 2 commits into from
Oct 8, 2013
Merged
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
18 changes: 0 additions & 18 deletions src/librustc/middle/trans/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ pub fn trans_struct_drop_flag(bcx: @mut Block, t: ty::t, v0: ValueRef, dtor_did:
bcx = drop_ty(bcx, llfld_a, fld.mt.ty);
}

Store(bcx, C_u8(0), drop_flag);
bcx
}
}
Expand Down Expand Up @@ -595,23 +594,6 @@ pub fn make_take_glue(bcx: @mut Block, v: ValueRef, t: ty::t) -> @mut Block {
bcx
}
ty::ty_opaque_closure_ptr(_) => bcx,
ty::ty_struct(did, _) => {
let tcx = bcx.tcx();
let bcx = iter_structural_ty(bcx, v, t, take_ty);

match ty::ty_dtor(tcx, did) {
ty::TraitDtor(_, false) => {
// Zero out the struct
unsafe {
let ty = Type::from_ref(llvm::LLVMTypeOf(v));
memzero(&B(bcx), v, ty);
}

}
_ => { }
}
bcx
}
_ if ty::type_is_structural(t) => {
iter_structural_ty(bcx, v, t, take_ty)
}
Expand Down