about summary refs log tree commit diff
path: root/src/test/compile-fail/liveness-block-unint.rs
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-05-19 05:52:01 -0700
committerNiko Matsakis <niko@alum.mit.edu>2012-05-24 09:52:03 -0700
commit30b47649ea37d211ee2dec4c541e6ba1e64c31a8 (patch)
treeb6b5825a2711f7911bd64bd1e505d44253d4e256 /src/test/compile-fail/liveness-block-unint.rs
parenta3be0b105436118e187ea52deb89788afaf1edb5 (diff)
downloadrust-30b47649ea37d211ee2dec4c541e6ba1e64c31a8.tar.gz
rust-30b47649ea37d211ee2dec4c541e6ba1e64c31a8.zip
new liveness pass to supercede last_use / initedness
Diffstat (limited to 'src/test/compile-fail/liveness-block-unint.rs')
-rw-r--r--src/test/compile-fail/liveness-block-unint.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/compile-fail/liveness-block-unint.rs b/src/test/compile-fail/liveness-block-unint.rs
new file mode 100644
index 00000000000..698f9f7cf79
--- /dev/null
+++ b/src/test/compile-fail/liveness-block-unint.rs
@@ -0,0 +1,7 @@
+fn force(f: fn()) { f(); }
+fn main() {
+    let x: int;
+    force(fn&() {
+        log(debug, x); //! ERROR capture of possibly uninitialized variable: `x`
+    });
+}