aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/writing-through-uninit-vec.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/compile-fail/writing-through-uninit-vec.rs b/src/test/compile-fail/writing-through-uninit-vec.rs
new file mode 100644
index 00000000..55edbf87
--- /dev/null
+++ b/src/test/compile-fail/writing-through-uninit-vec.rs
@@ -0,0 +1,10 @@
+// error-pattern: Unsatisfied precondition constraint
+
+fn test() {
+ let vec[int] w;
+ w.(5) = 0;
+}
+
+fn main() {
+ test();
+} \ No newline at end of file