Skip to content

Commit 8d56158

Browse files
committed
stop initializing ref_count for stack closures
the only part of the header ~fn and &fn should be touching right now is the tydesc
1 parent 93c270c commit 8d56158

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/librustc/middle/trans/closure.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,6 @@ pub fn allocate_cbox(bcx: block, sigil: ast::Sigil, cdata_ty: ty::t)
174174
let ccx = bcx.ccx();
175175
let tcx = ccx.tcx;
176176

177-
fn nuke_ref_count(bcx: block, llbox: ValueRef) {
178-
let _icx = push_ctxt("closure::nuke_ref_count");
179-
// Initialize ref count to arbitrary value for debugging:
180-
let ccx = bcx.ccx();
181-
let llbox = PointerCast(bcx, llbox, Type::opaque_box(ccx).ptr_to());
182-
let ref_cnt = GEPi(bcx, llbox, [0u, abi::box_field_refcnt]);
183-
let rc = C_int(ccx, 0x12345678);
184-
Store(bcx, rc, ref_cnt);
185-
}
186-
187177
// Allocate and initialize the box:
188178
match sigil {
189179
ast::ManagedSigil => {
@@ -195,7 +185,6 @@ pub fn allocate_cbox(bcx: block, sigil: ast::Sigil, cdata_ty: ty::t)
195185
ast::BorrowedSigil => {
196186
let cbox_ty = tuplify_box_ty(tcx, cdata_ty);
197187
let llbox = alloc_ty(bcx, cbox_ty, "__closure");
198-
nuke_ref_count(bcx, llbox);
199188
rslt(bcx, llbox)
200189
}
201190
}

0 commit comments

Comments
 (0)