Skip to content

Commit ea81c03

Browse files
committed
Revert "Handle conditionals on _|_ - typed values correctly"
This reverts commit 13f8b3f. run-pass/if-ret.rs does not translate correctly when unoptimized. Issue rust-lang#797
1 parent d08c0f0 commit ea81c03

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/comp/middle/trans.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3592,18 +3592,6 @@ fn trans_if(cx: &@block_ctxt, cond: &@ast::expr, thn: &ast::blk,
35923592
els: &option::t[@ast::expr], id: ast::node_id,
35933593
output: &out_method) -> result {
35943594
let cond_res = trans_expr(cx, cond);
3595-
3596-
if (ty::type_is_bot(bcx_tcx(cx), ty::expr_ty(bcx_tcx(cx), cond))) {
3597-
// No need to generate code for comparison,
3598-
// since the cond diverges.
3599-
if (!cx.build.is_terminated()) {
3600-
ret rslt(cx, cx.build.Unreachable());
3601-
}
3602-
else {
3603-
ret rslt(cx, C_nil());
3604-
}
3605-
}
3606-
36073595
let then_cx = new_scope_block_ctxt(cx, "then");
36083596
let then_res = trans_block(then_cx, thn, output);
36093597
let else_cx = new_scope_block_ctxt(cx, "else");

src/test/run-fail/if-cond-bot.rs

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)