Skip to content

Commit eaa3561

Browse files
committed
Add XFAIL'ed test for return-in-iter, call unimpl when we find it. Closes #100.
1 parent c96634a commit eaa3561

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ TEST_XFAILS_X86 := $(MUT_BOX_XFAILS) \
370370
test/run-pass/fn-lval.rs \
371371
test/run-pass/generic-fn-infer.rs \
372372
test/run-pass/generic-recursive-tag.rs \
373+
test/run-pass/iter-ret.rs \
373374
test/run-pass/mlist-cycle.rs \
374375
test/run-pass/mutable-vec-drop.rs \
375376
test/run-pass/obj-as.rs \
@@ -430,6 +431,7 @@ TEST_XFAILS_LLVM := $(addprefix test/run-pass/, \
430431
import.rs \
431432
inner-module.rs \
432433
iter-range.rs \
434+
iter-ret.rs \
433435
large-records.rs \
434436
lazy-and-or.rs \
435437
lazy-init.rs \

src/boot/me/trans.ml

+2
Original file line numberDiff line numberDiff line change
@@ -4532,6 +4532,8 @@ let trans_visitor
45324532
calls
45334533

45344534
| Ast.STMT_ret atom_opt ->
4535+
if get_stmt_depth cx stmt.id > 0
4536+
then unimpl (Some stmt.id) "ret within iterator-block";
45354537
begin
45364538
match atom_opt with
45374539
None -> ()

src/test/run-pass/iter-ret.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
iter x() -> int {
2+
}
3+
4+
fn f() -> bool {
5+
for each (int i in x()) {
6+
ret true;
7+
}
8+
ret false;
9+
}
10+
11+
fn main(vec[str] args) -> () {
12+
f();
13+
}

0 commit comments

Comments
 (0)