Skip to content

Commit

Permalink
Add XFAIL'ed test for return-in-iter, call unimpl when we find it. Cl…
Browse files Browse the repository at this point in the history
…oses rust-lang#100.
  • Loading branch information
graydon committed Jul 22, 2010
1 parent c96634a commit eaa3561
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ TEST_XFAILS_X86 := $(MUT_BOX_XFAILS) \
test/run-pass/fn-lval.rs \
test/run-pass/generic-fn-infer.rs \
test/run-pass/generic-recursive-tag.rs \
test/run-pass/iter-ret.rs \
test/run-pass/mlist-cycle.rs \
test/run-pass/mutable-vec-drop.rs \
test/run-pass/obj-as.rs \
Expand Down Expand Up @@ -430,6 +431,7 @@ TEST_XFAILS_LLVM := $(addprefix test/run-pass/, \
import.rs \
inner-module.rs \
iter-range.rs \
iter-ret.rs \
large-records.rs \
lazy-and-or.rs \
lazy-init.rs \
Expand Down
2 changes: 2 additions & 0 deletions src/boot/me/trans.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4532,6 +4532,8 @@ let trans_visitor
calls

| Ast.STMT_ret atom_opt ->
if get_stmt_depth cx stmt.id > 0
then unimpl (Some stmt.id) "ret within iterator-block";
begin
match atom_opt with
None -> ()
Expand Down
13 changes: 13 additions & 0 deletions src/test/run-pass/iter-ret.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
iter x() -> int {
}

fn f() -> bool {
for each (int i in x()) {
ret true;
}
ret false;
}

fn main(vec[str] args) -> () {
f();
}

0 comments on commit eaa3561

Please sign in to comment.