Skip to content

Commit 779dd80

Browse files
committed
rustc: Blocks shouldn't try to return results for ty_bot
1 parent 7b4eec2 commit 779dd80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6425,7 +6425,8 @@ fn trans_block(&@block_ctxt cx, &ast::block b) -> result {
64256425
ret r;
64266426
} else {
64276427
auto r_ty = ty::expr_ty(cx.fcx.lcx.ccx.tcx, e);
6428-
if (!ty::type_is_nil(cx.fcx.lcx.ccx.tcx, r_ty)) {
6428+
if (!ty::type_is_nil(cx.fcx.lcx.ccx.tcx, r_ty)
6429+
&& !ty::type_is_bot(cx.fcx.lcx.ccx.tcx, r_ty)) {
64296430
// The value resulting from the block gets copied into an
64306431
// alloca created in an outer scope and its refcount
64316432
// bumped so that it can escape this block. This means

0 commit comments

Comments
 (0)