diff options
| author | Graydon Hoare <[email protected]> | 2010-07-22 12:24:55 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-22 12:24:55 -0700 |
| commit | eaa35611dc2c66d73032ece1ddde7881fcaccdee (patch) | |
| tree | cbc01266700dafadc468bc4947b7053d3014f881 /src | |
| parent | Fix mem op= mem bug in trans.ml (via not terribly good fix). Closes #111. (diff) | |
| download | rust-eaa35611dc2c66d73032ece1ddde7881fcaccdee.tar.xz rust-eaa35611dc2c66d73032ece1ddde7881fcaccdee.zip | |
Add XFAIL'ed test for return-in-iter, call unimpl when we find it. Closes #100.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 2 | ||||
| -rw-r--r-- | src/boot/me/trans.ml | 2 | ||||
| -rw-r--r-- | src/test/run-pass/iter-ret.rs | 13 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile index 9d6eed19..de88a931 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 \ @@ -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 \ diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml index be7adc1a..07b22dca 100644 --- a/src/boot/me/trans.ml +++ b/src/boot/me/trans.ml @@ -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 -> () diff --git a/src/test/run-pass/iter-ret.rs b/src/test/run-pass/iter-ret.rs new file mode 100644 index 00000000..12eb9b4e --- /dev/null +++ b/src/test/run-pass/iter-ret.rs @@ -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(); +} |