diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 4f9dd2f9a341..9223eaaa121c 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -6425,7 +6425,8 @@ fn trans_block(&@block_ctxt cx, &ast::block b) -> result { ret r; } else { auto r_ty = ty::expr_ty(cx.fcx.lcx.ccx.tcx, e); - if (!ty::type_is_nil(cx.fcx.lcx.ccx.tcx, r_ty)) { + if (!ty::type_is_nil(cx.fcx.lcx.ccx.tcx, r_ty) + && !ty::type_is_bot(cx.fcx.lcx.ccx.tcx, r_ty)) { // The value resulting from the block gets copied into an // alloca created in an outer scope and its refcount // bumped so that it can escape this block. This means