aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/return-uninit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/compile-fail/return-uninit.rs')
-rw-r--r--src/test/compile-fail/return-uninit.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/compile-fail/return-uninit.rs b/src/test/compile-fail/return-uninit.rs
new file mode 100644
index 00000000..37117169
--- /dev/null
+++ b/src/test/compile-fail/return-uninit.rs
@@ -0,0 +1,10 @@
+// error-pattern: precondition constraint
+
+fn f() -> int {
+ let int x;
+ ret x;
+}
+
+fn main() {
+ f();
+} \ No newline at end of file