about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2019-07-28 16:26:01 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2019-07-28 16:26:01 +0900
commit29a00ef4a61adae3329cb3ce4cf65201169d6e57 (patch)
tree7a0b1da20f25b891ff7157d22c1873763c28f652
parent9a239ef4ded03d155c72b68b5a2dd7aff013e141 (diff)
downloadrust-29a00ef4a61adae3329cb3ce4cf65201169d6e57.tar.gz
rust-29a00ef4a61adae3329cb3ce4cf65201169d6e57.zip
Add test for issue-50900
-rw-r--r--src/test/ui/issues/issue-50900.rs19
-rw-r--r--src/test/ui/issues/issue-50900.stderr14
2 files changed, 33 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-50900.rs b/src/test/ui/issues/issue-50900.rs
new file mode 100644
index 00000000000..27135af9575
--- /dev/null
+++ b/src/test/ui/issues/issue-50900.rs
@@ -0,0 +1,19 @@
+#[derive(PartialEq, Eq)]
+pub struct Tag(pub Context, pub u16);
+
+#[derive(PartialEq, Eq)]
+pub enum Context {
+    Tiff,
+    Exif,
+}
+
+impl Tag {
+    const ExifIFDPointer: Tag = Tag(Context::Tiff, 34665);
+}
+
+fn main() {
+    match Tag::ExifIFDPointer {
+    //~^ ERROR: non-exhaustive patterns: `Tag(Exif, _)` not covered
+        Tag::ExifIFDPointer => {}
+    }
+}
diff --git a/src/test/ui/issues/issue-50900.stderr b/src/test/ui/issues/issue-50900.stderr
new file mode 100644
index 00000000000..7192f11a5e8
--- /dev/null
+++ b/src/test/ui/issues/issue-50900.stderr
@@ -0,0 +1,14 @@
+error[E0004]: non-exhaustive patterns: `Tag(Exif, _)` not covered
+  --> $DIR/issue-50900.rs:15:11
+   |
+LL | pub struct Tag(pub Context, pub u16);
+   | ------------------------------------- `Tag` defined here
+...
+LL |     match Tag::ExifIFDPointer {
+   |           ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Exif, _)` not covered
+   |
+   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0004`.