aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-06 23:18:29 -0700
committerGraydon Hoare <[email protected]>2010-07-06 23:18:29 -0700
commite813388df8df90d0db658e1e745a0a8a4d27ad8c (patch)
tree7920e0bc4d38fdb418c452388afda0e4b6f55f63 /src/test/compile-fail
parentCorrect flow-graph wiring for STMT_if. (diff)
downloadrust-e813388df8df90d0db658e1e745a0a8a4d27ad8c.tar.xz
rust-e813388df8df90d0db658e1e745a0a8a4d27ad8c.zip
Numerous bug fixes to typestate algorithm.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/use-uninit.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/compile-fail/use-uninit.rs b/src/test/compile-fail/use-uninit.rs
new file mode 100644
index 00000000..5790bfbd
--- /dev/null
+++ b/src/test/compile-fail/use-uninit.rs
@@ -0,0 +1,14 @@
+// error-pattern:Unsatisfied precondition
+
+fn foo(int x) {
+ log x;
+}
+
+fn main() {
+ let int x;
+ if (1 > 2) {
+ x = 10;
+ } else {
+ }
+ foo(x);
+} \ No newline at end of file