2011-05-12 14:45:29 -05:00
|
|
|
// error-pattern:Unsatisfied precondition
|
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.
2011-04-21 19:39:04 -05:00
|
|
|
|
|
|
|
fn foo() -> int {
|
|
|
|
let int x;
|
|
|
|
let int i;
|
|
|
|
|
|
|
|
do {
|
|
|
|
i = 0;
|
|
|
|
break;
|
|
|
|
x = 0;
|
2011-06-17 13:10:51 -05:00
|
|
|
} while (x != 0);
|
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.
2011-04-21 19:39:04 -05:00
|
|
|
|
|
|
|
log(x);
|
|
|
|
|
|
|
|
ret 17;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
log(foo());
|
|
|
|
}
|