summaryrefslogtreecommitdiffstats
path: root/tests/ui/enum/union-in-enum.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/enum/union-in-enum.rs')
-rw-r--r--tests/ui/enum/union-in-enum.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/enum/union-in-enum.rs b/tests/ui/enum/union-in-enum.rs
new file mode 100644
index 000000000..048913e25
--- /dev/null
+++ b/tests/ui/enum/union-in-enum.rs
@@ -0,0 +1,13 @@
+// This test checks that the union keyword
+// is accepted as the name of an enum variant
+// when not followed by an identifier
+// This special case exists because `union` is a contextual keyword.
+
+#![allow(warnings)]
+
+// check-pass
+
+enum A { union }
+enum B { union {} }
+enum C { union() }
+fn main(){}