summaryrefslogtreecommitdiffstats
path: root/tests/ui/uninhabited/projection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/uninhabited/projection.rs')
-rw-r--r--tests/ui/uninhabited/projection.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui/uninhabited/projection.rs b/tests/ui/uninhabited/projection.rs
new file mode 100644
index 000000000..be0d3ff7d
--- /dev/null
+++ b/tests/ui/uninhabited/projection.rs
@@ -0,0 +1,32 @@
+// check-pass
+
+#![feature(never_type, exhaustive_patterns)]
+
+trait Tag {
+ type TagType;
+}
+
+enum Keep {}
+enum Erase {}
+
+impl Tag for Keep {
+ type TagType = ();
+}
+
+impl Tag for Erase {
+ type TagType = !;
+}
+
+enum TagInt<T: Tag> {
+ Untagged(i32),
+ Tagged(T::TagType, i32)
+}
+
+fn test(keep: TagInt<Keep>, erase: TagInt<Erase>) {
+ match erase {
+ TagInt::Untagged(_) => (),
+ TagInt::Tagged(_, _) => ()
+ };
+}
+
+fn main() {}