From 395e453c06cce045d2e0613a1c6edab2dcfdeceb Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 4 Sep 2014 23:58:39 -0400 Subject: [PATCH] fix a sized deallocation issue in the glue code --- src/librustc/middle/trans/glue.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index c8a47532a92..624fbc5c46c 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -111,9 +111,6 @@ pub fn get_drop_glue_type(ccx: &CrateContext, t: ty::t) -> ty::t { return ty::mk_i8(); } match ty::get(t).sty { - ty::ty_box(typ) if !ty::type_needs_drop(tcx, typ) => - ty::mk_box(tcx, ty::mk_i8()), - ty::ty_uniq(typ) if !ty::type_needs_drop(tcx, typ) && ty::type_is_sized(tcx, typ) => { let llty = sizing_type_of(ccx, typ); @@ -121,7 +118,7 @@ pub fn get_drop_glue_type(ccx: &CrateContext, t: ty::t) -> ty::t { if llsize_of_alloc(ccx, llty) == 0 { ty::mk_i8() } else { - ty::mk_uniq(tcx, ty::mk_i8()) + t } } _ => t