diff options
| author | Tim Chevalier <[email protected]> | 2011-04-21 17:39:04 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-04-28 13:26:19 -0700 |
| commit | 0190ebfe0748f28c290eb4759a03ffbd416cbeac (patch) | |
| tree | a419e87e4071017aa52399f74646865f3f2c22ae /src/test/compile-fail/break-uninit2.rs | |
| parent | Further work on typestate_check (diff) | |
| download | rust-0190ebfe0748f28c290eb4759a03ffbd416cbeac.tar.xz rust-0190ebfe0748f28c290eb4759a03ffbd416cbeac.zip | |
Support all expression forms in typestate
Added support for self_method, cont, chan, port, recv, send, be,
do_while, spawn, and ext; handled break and cont correctly.
(However, there are no non-xfailed test cases for ext or spawn in
stage0 currently.)
Although the standard library compiles and all test cases pass with
typestate enabled, I left typestate checking disabled as rustc
terminates abnormally when building the standard library if so,
even though it does generate code correctly.
Diffstat (limited to 'src/test/compile-fail/break-uninit2.rs')
| -rw-r--r-- | src/test/compile-fail/break-uninit2.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/compile-fail/break-uninit2.rs b/src/test/compile-fail/break-uninit2.rs new file mode 100644 index 00000000..8ef83f08 --- /dev/null +++ b/src/test/compile-fail/break-uninit2.rs @@ -0,0 +1,22 @@ +// xfail-boot +// xfail-stage0 +// error-pattern:Unsatisfied precondition + +fn foo() -> int { + let int x; + let int i; + + do { + i = 0; + break; + x = 0; + } while (1 != 2); + + log(x); + + ret 17; +} + +fn main() { + log(foo()); +} |