summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/lazy-init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/lazy-init.rs')
-rw-r--r--tests/ui/borrowck/lazy-init.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/borrowck/lazy-init.rs b/tests/ui/borrowck/lazy-init.rs
new file mode 100644
index 000000000..a4b5d18bb
--- /dev/null
+++ b/tests/ui/borrowck/lazy-init.rs
@@ -0,0 +1,8 @@
+// run-pass
+
+#![allow(unused_mut)]
+
+
+fn foo(x: isize) { println!("{}", x); }
+
+pub fn main() { let mut x: isize; if 1 > 2 { x = 12; } else { x = 10; } foo(x); }