Skip to content

Commit 7505c1f

Browse files
committed
rustc: Run cleanups on while expressions' condition blocks. Un-XFAIL while-prelude-drop.rs.
1 parent 0d3cec7 commit 7505c1f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
513513
vec-alloc-append.rs \
514514
vec-append.rs \
515515
vec-slice.rs \
516-
while-prelude-drop.rs \
517516
while-with-break.rs \
518517
yield.rs \
519518
yield2.rs \

src/comp/middle/trans.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3005,9 +3005,9 @@ fn trans_while(@block_ctxt cx, @ast.expr cond,
30053005
auto cond_res = trans_expr(cond_cx, cond);
30063006

30073007
body_res.bcx.build.Br(cond_cx.llbb);
3008-
cond_res.bcx.build.CondBr(cond_res.val,
3009-
body_cx.llbb,
3010-
next_cx.llbb);
3008+
3009+
auto cond_bcx = trans_block_cleanups(cond_res.bcx, cond_cx);
3010+
cond_bcx.build.CondBr(cond_res.val, body_cx.llbb, next_cx.llbb);
30113011

30123012
cx.build.Br(cond_cx.llbb);
30133013
ret res(next_cx, C_nil());

0 commit comments

Comments
 (0)