Skip to content

Commit 395e453

Browse files
committed
fix a sized deallocation issue in the glue code
1 parent 6eabd85 commit 395e453

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,14 @@ pub fn get_drop_glue_type(ccx: &CrateContext, t: ty::t) -> ty::t {
111111
return ty::mk_i8();
112112
}
113113
match ty::get(t).sty {
114-
ty::ty_box(typ) if !ty::type_needs_drop(tcx, typ) =>
115-
ty::mk_box(tcx, ty::mk_i8()),
116-
117114
ty::ty_uniq(typ) if !ty::type_needs_drop(tcx, typ)
118115
&& ty::type_is_sized(tcx, typ) => {
119116
let llty = sizing_type_of(ccx, typ);
120117
// `Box<ZeroSizeType>` does not allocate.
121118
if llsize_of_alloc(ccx, llty) == 0 {
122119
ty::mk_i8()
123120
} else {
124-
ty::mk_uniq(tcx, ty::mk_i8())
121+
t
125122
}
126123
}
127124
_ => t

0 commit comments

Comments
 (0)