about summary refs log tree commit diff
path: root/tests/ui/consts/const-enum-byref-self.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/const-enum-byref-self.rs')
-rw-r--r--tests/ui/consts/const-enum-byref-self.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/consts/const-enum-byref-self.rs b/tests/ui/consts/const-enum-byref-self.rs
new file mode 100644
index 00000000000..b7e14bfb765
--- /dev/null
+++ b/tests/ui/consts/const-enum-byref-self.rs
@@ -0,0 +1,18 @@
+// run-pass
+#![allow(dead_code)]
+
+enum E { V, VV(isize) }
+static C: E = E::V;
+
+impl E {
+    pub fn method(&self) {
+        match *self {
+            E::V => {}
+            E::VV(..) => panic!()
+        }
+    }
+}
+
+pub fn main() {
+    C.method()
+}