Skip to content

Commit e4362a5

Browse files
committed
Remove the empty tuple of tydescs from closures. Closes #2531.
1 parent 95dd9f3 commit e4362a5

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/rustc/back/abi.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ const cmp_glue_op_le: uint = 2u;
6060
const fn_field_code: uint = 0u;
6161
const fn_field_box: uint = 1u;
6262

63-
// closures, see trans_closure.rs
64-
const closure_body_ty_params: uint = 0u;
65-
const closure_body_bindings: uint = 1u;
66-
6763
const vec_elt_fill: uint = 0u;
6864

6965
const vec_elt_alloc: uint = 1u;

src/rustc/middle/trans/closure.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ fn mk_closure_tys(tcx: ty::ctxt,
130130
env_ref(_, t, _) { t }
131131
});
132132
}
133-
let bound_data_ty = ty::mk_tup(tcx, bound_tys);
134-
// FIXME[mono] remove tuple of tydescs from closure types (#2531)
135-
let cdata_ty = ty::mk_tup(tcx, ~[ty::mk_tup(tcx, ~[]),
136-
bound_data_ty]);
133+
let cdata_ty = ty::mk_tup(tcx, bound_tys);
137134
#debug["cdata_ty=%s", ty_to_str(tcx, cdata_ty)];
138135
ret cdata_ty;
139136
}
@@ -217,7 +214,7 @@ fn store_environment(bcx: block,
217214
}
218215

219216
let bound_data = GEPi(bcx, llbox,
220-
~[0u, abi::box_field_body, abi::closure_body_bindings, i]);
217+
~[0u, abi::box_field_body, i]);
221218
alt bv {
222219
env_copy(val, ty, owned) {
223220
let val1 = load_if_immediate(bcx, val, ty);
@@ -334,7 +331,7 @@ fn load_environment(fcx: fn_ctxt,
334331
capture::cap_drop { /* ignore */ }
335332
_ {
336333
let mut upvarptr =
337-
GEPi(bcx, llcdata, ~[0u, abi::closure_body_bindings, i]);
334+
GEPi(bcx, llcdata, ~[0u, i]);
338335
alt ck {
339336
ty::ck_block { upvarptr = Load(bcx, upvarptr); }
340337
ty::ck_uniq | ty::ck_box { }
@@ -347,10 +344,10 @@ fn load_environment(fcx: fn_ctxt,
347344
}
348345
if load_ret_handle {
349346
let flagptr = Load(bcx, GEPi(bcx, llcdata,
350-
~[0u, abi::closure_body_bindings, i]));
347+
~[0u, i]));
351348
let retptr = Load(bcx,
352349
GEPi(bcx, llcdata,
353-
~[0u, abi::closure_body_bindings, i+1u]));
350+
~[0u, i+1u]));
354351
fcx.loop_ret = some({flagptr: flagptr, retptr: retptr});
355352
}
356353
}

0 commit comments

Comments
 (0)