Skip to content

Commit d4533c8

Browse files
committed
---
yaml --- r: 3594 b: refs/heads/master c: a793b85 h: refs/heads/master v: v3
1 parent e561b85 commit d4533c8

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ded9008e3850463a21d1d0d48ad35a02e42bae7c
2+
refs/heads/master: a793b85fbd92c8937d219d62928a5019d21bf821

trunk/src/comp/middle/trans.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4564,7 +4564,11 @@ fn trans_for_each(&@block_ctxt cx, &@ast::local local, &@ast::expr seq,
45644564
auto lltop = bcx.llbb;
45654565
auto r = trans_block(bcx, body, return);
45664566
finish_fn(fcx, lltop);
4567-
r.bcx.build.RetVoid();
4567+
4568+
if (!r.bcx.build.is_terminated()) {
4569+
// if terminated is true, no need for the ret-fail
4570+
r.bcx.build.RetVoid();
4571+
}
45684572

45694573
// Step 3: Call iter passing [lliterbody, llenv], plus other args.
45704574
alt (seq.node) {

trunk/src/test/run-fail/fail-main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// xfail-stage0
2+
// error-pattern:moop
3+
use std;
4+
import std::uint;
5+
fn main() {
6+
fail "moop";
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// xfail-stage0
2+
// error-pattern:moop
3+
use std;
4+
import std::uint;
5+
fn main() {
6+
for each (uint i in uint::range(0u, 10u)) {
7+
fail "moop";
8+
}
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// xfail-stage0
2+
fn main() {
3+
let vec[int] x = [];
4+
for (int i in x) {
5+
fail "moop";
6+
}
7+
}

0 commit comments

Comments
 (0)