summaryrefslogtreecommitdiffstats
path: root/src/test/ui/variants/variant-used-as-type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/variants/variant-used-as-type.rs')
-rw-r--r--src/test/ui/variants/variant-used-as-type.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/variants/variant-used-as-type.rs b/src/test/ui/variants/variant-used-as-type.rs
new file mode 100644
index 000000000..f27db1024
--- /dev/null
+++ b/src/test/ui/variants/variant-used-as-type.rs
@@ -0,0 +1,20 @@
+// Test error message when enum variants are used as types
+
+
+// issue 21225
+enum Ty {
+ A,
+ B(Ty::A),
+ //~^ ERROR expected type, found variant `Ty::A`
+}
+
+
+// issue 19197
+enum E {
+ A
+}
+
+impl E::A {}
+//~^ ERROR expected type, found variant `E::A`
+
+fn main() {}