Remove the empty tuple of tydescs from closures. Closes #2531.
This commit is contained in:
parent
95dd9f3204
commit
e4362a59b9
2 changed files with 5 additions and 12 deletions
|
@ -60,10 +60,6 @@ const cmp_glue_op_le: uint = 2u;
|
||||||
const fn_field_code: uint = 0u;
|
const fn_field_code: uint = 0u;
|
||||||
const fn_field_box: uint = 1u;
|
const fn_field_box: uint = 1u;
|
||||||
|
|
||||||
// closures, see trans_closure.rs
|
|
||||||
const closure_body_ty_params: uint = 0u;
|
|
||||||
const closure_body_bindings: uint = 1u;
|
|
||||||
|
|
||||||
const vec_elt_fill: uint = 0u;
|
const vec_elt_fill: uint = 0u;
|
||||||
|
|
||||||
const vec_elt_alloc: uint = 1u;
|
const vec_elt_alloc: uint = 1u;
|
||||||
|
|
|
@ -130,10 +130,7 @@ fn mk_closure_tys(tcx: ty::ctxt,
|
||||||
env_ref(_, t, _) { t }
|
env_ref(_, t, _) { t }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let bound_data_ty = ty::mk_tup(tcx, bound_tys);
|
let cdata_ty = ty::mk_tup(tcx, bound_tys);
|
||||||
// FIXME[mono] remove tuple of tydescs from closure types (#2531)
|
|
||||||
let cdata_ty = ty::mk_tup(tcx, ~[ty::mk_tup(tcx, ~[]),
|
|
||||||
bound_data_ty]);
|
|
||||||
#debug["cdata_ty=%s", ty_to_str(tcx, cdata_ty)];
|
#debug["cdata_ty=%s", ty_to_str(tcx, cdata_ty)];
|
||||||
ret cdata_ty;
|
ret cdata_ty;
|
||||||
}
|
}
|
||||||
|
@ -217,7 +214,7 @@ fn store_environment(bcx: block,
|
||||||
}
|
}
|
||||||
|
|
||||||
let bound_data = GEPi(bcx, llbox,
|
let bound_data = GEPi(bcx, llbox,
|
||||||
~[0u, abi::box_field_body, abi::closure_body_bindings, i]);
|
~[0u, abi::box_field_body, i]);
|
||||||
alt bv {
|
alt bv {
|
||||||
env_copy(val, ty, owned) {
|
env_copy(val, ty, owned) {
|
||||||
let val1 = load_if_immediate(bcx, val, ty);
|
let val1 = load_if_immediate(bcx, val, ty);
|
||||||
|
@ -334,7 +331,7 @@ fn load_environment(fcx: fn_ctxt,
|
||||||
capture::cap_drop { /* ignore */ }
|
capture::cap_drop { /* ignore */ }
|
||||||
_ {
|
_ {
|
||||||
let mut upvarptr =
|
let mut upvarptr =
|
||||||
GEPi(bcx, llcdata, ~[0u, abi::closure_body_bindings, i]);
|
GEPi(bcx, llcdata, ~[0u, i]);
|
||||||
alt ck {
|
alt ck {
|
||||||
ty::ck_block { upvarptr = Load(bcx, upvarptr); }
|
ty::ck_block { upvarptr = Load(bcx, upvarptr); }
|
||||||
ty::ck_uniq | ty::ck_box { }
|
ty::ck_uniq | ty::ck_box { }
|
||||||
|
@ -347,10 +344,10 @@ fn load_environment(fcx: fn_ctxt,
|
||||||
}
|
}
|
||||||
if load_ret_handle {
|
if load_ret_handle {
|
||||||
let flagptr = Load(bcx, GEPi(bcx, llcdata,
|
let flagptr = Load(bcx, GEPi(bcx, llcdata,
|
||||||
~[0u, abi::closure_body_bindings, i]));
|
~[0u, i]));
|
||||||
let retptr = Load(bcx,
|
let retptr = Load(bcx,
|
||||||
GEPi(bcx, llcdata,
|
GEPi(bcx, llcdata,
|
||||||
~[0u, abi::closure_body_bindings, i+1u]));
|
~[0u, i+1u]));
|
||||||
fcx.loop_ret = some({flagptr: flagptr, retptr: retptr});
|
fcx.loop_ret = some({flagptr: flagptr, retptr: retptr});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue