Skip to content

Commit 4479c7e

Browse files
committed
---
yaml --- r: 5730 b: refs/heads/master c: c7eee8f h: refs/heads/master v: v3
1 parent c7b1c32 commit 4479c7e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 31586339b14e8c4167c3bf80d375881f3ff2fb19
2+
refs/heads/master: c7eee8fb059fc9639f2a4e5ef749dc3701bf3377

trunk/src/comp/middle/trans_common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,13 @@ tag cleanup {
264264
}
265265

266266
fn add_clean(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
267+
if !ty::type_needs_drop(bcx_tcx(cx), ty) { ret; }
267268
let scope_cx = find_scope_cx(cx);
268269
scope_cx.cleanups += [clean(bind drop_ty(_, val, ty))];
269270
scope_cx.lpad_dirty = true;
270271
}
271272
fn add_clean_temp(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
273+
if !ty::type_needs_drop(bcx_tcx(cx), ty) { ret; }
272274
fn spill_and_drop(cx: @block_ctxt, val: ValueRef, ty: ty::t) ->
273275
@block_ctxt {
274276
let bcx = cx;
@@ -283,6 +285,7 @@ fn add_clean_temp(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
283285
scope_cx.lpad_dirty = true;
284286
}
285287
fn add_clean_temp_mem(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
288+
if !ty::type_needs_drop(bcx_tcx(cx), ty) { ret; }
286289
let scope_cx = find_scope_cx(cx);
287290
scope_cx.cleanups += [clean_temp(val, bind drop_ty(_, val, ty))];
288291
scope_cx.lpad_dirty = true;

0 commit comments

Comments
 (0)