about summary refs log tree commit diff
path: root/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs')
-rw-r--r--src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs b/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs
new file mode 100644
index 00000000000..9c982292816
--- /dev/null
+++ b/src/test/compile-fail/liveness-ctor-access-self-with-uninit-fields.rs
@@ -0,0 +1,11 @@
+class cat {
+  let how_hungry : int;
+  fn meow() {}
+  new() {
+     self.meow();
+     //!^ ERROR use of possibly uninitialized field: `self.how_hungry`
+  }
+}
+
+fn main() {
+}