We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 498ad91 commit d673f76Copy full SHA for d673f76
src/comp/middle/trans.rs
@@ -4463,14 +4463,10 @@ fn trans_closure(cx: @local_ctxt, sp: span, decl: ast::fn_decl,
4463
// translation calls that don't have a return value (trans_crate,
4464
// trans_mod, trans_item, et cetera) and those that do
4465
// (trans_block, trans_expr, et cetera).
4466
- if ty::type_is_bot(cx.ccx.tcx, block_ty) ||
4467
- ty::type_is_nil(cx.ccx.tcx, block_ty) ||
4468
- option::is_none(body.node.expr) {
4469
- bcx = trans_block_dps(bcx, body, ignore);
4470
- } else if ty::type_is_immediate(cx.ccx.tcx, block_ty) {
4471
- let cell = empty_dest_cell();
4472
- bcx = trans_block_dps(bcx, body, by_val(cell));
4473
- Store(bcx, *cell, fcx.llretptr);
+ if option::is_none(body.node.expr) ||
+ ty::type_is_bot(cx.ccx.tcx, block_ty) ||
+ ty::type_is_nil(cx.ccx.tcx, block_ty) {
+ bcx = trans_block(bcx, body);
4474
} else {
4475
bcx = trans_block_dps(bcx, body, save_in(fcx.llretptr));
4476
}
0 commit comments